From a6788f0842075f01d3686db6ec8069acf39a4a85 Mon Sep 17 00:00:00 2001 From: Mitchell Field Date: Sun, 20 Feb 2011 06:10:24 +1100 Subject: [PATCH] Bug 627277 - Remove (broken) BeOS support. r=biesi,dwitte,gavin,joe,jorendorff,josh,khuey,mfinkle,neil,Pike,roc,shaver,smontagu,taras --- Makefile.in | 2 +- browser/app/Makefile.in | 7 - browser/app/apprunner-beos.rsrc | Bin 10792 -> 0 bytes browser/components/build/nsModule.cpp | 10 - browser/components/migration/src/Makefile.in | 5 +- .../migration/src/nsOperaProfileMigrator.cpp | 8 - .../src/nsPhoenixProfileMigrator.cpp | 5 - .../migration/src/nsProfileMigrator.cpp | 6 - .../src/nsSeamonkeyProfileMigrator.cpp | 5 - build/unix/run-mozilla.sh | 6 - config/config.mk | 3 - config/rules.mk | 12 - configure.in | 50 +- db/mork/src/morkConfig.h | 12 +- db/mork/src/morkFile.cpp | 4 +- db/mork/src/morkStream.cpp | 4 +- docshell/base/nsDefaultURIFixup.cpp | 2 +- gfx/src/nsIRenderingContext.h | 2 +- gfx/src/thebes/Makefile.in | 4 - gfx/src/thebes/nsSystemFontsBeOS.cpp | 136 - gfx/src/thebes/nsSystemFontsBeOS.h | 76 - gfx/src/thebes/nsThebesDeviceContext.cpp | 5 - gfx/src/thebes/nsThebesRenderingContext.cpp | 4 +- gfx/src/thebes/nsThebesRenderingContext.h | 2 +- gfx/thebes/Makefile.in | 25 - gfx/thebes/gfxBeOSPlatform.cpp | 118 - gfx/thebes/gfxBeOSPlatform.h | 76 - gfx/thebes/gfxBeOSSurface.cpp | 74 - gfx/thebes/gfxBeOSSurface.h | 59 - gfx/thebes/gfxPlatform.cpp | 4 - intl/locale/src/nsLocaleConstructors.h | 2 +- intl/locale/src/nsLocaleService.cpp | 10 +- intl/uconv/src/Makefile.in | 3 - intl/uconv/src/nsBeOSCharset.cpp | 114 - js/src/Makefile.in | 4 +- js/src/config/config.mk | 3 - js/src/config/rules.mk | 12 - js/src/configure.in | 34 +- js/src/jscpucfg.h | 4 +- js/src/jsgcchunk.cpp | 4 +- js/src/jsotypes.h | 17 - js/src/prmjtime.cpp | 6 +- js/src/shell/js.cpp | 4 +- .../xpconnect/loader/mozJSComponentLoader.cpp | 2 +- js/src/xpconnect/shell/xpcshell.cpp | 4 +- layout/base/nsPresContext.cpp | 2 - modules/libjar/nsZipArchive.cpp | 10 +- modules/libjar/nsZipArchive.h | 2 +- modules/libpr0n/decoders/Makefile.in | 3 - modules/libpr0n/decoders/icon/Makefile.in | 5 - .../libpr0n/decoders/icon/beos/Makefile.in | 56 - .../decoders/icon/beos/nsIconChannel.cpp | 486 --- .../decoders/icon/beos/nsIconChannel.h | 84 - modules/libpref/src/Makefile.in | 2 +- modules/libpref/src/init/all.js | 96 - modules/libpref/src/prefapi.cpp | 4 - modules/plugin/base/src/Makefile.in | 5 - modules/plugin/base/src/nsPluginsDirBeOS.cpp | 297 -- netwerk/cache/nsDiskCacheDevice.cpp | 4 +- netwerk/protocol/http/nsHttpHandler.cpp | 6 +- rdf/datasource/src/nsFileSystemDataSource.cpp | 131 +- rdf/datasource/src/nsFileSystemDataSource.h | 7 +- .../commandlines/src/nsCommandLine.cpp | 35 - toolkit/components/filepicker/Makefile.in | 2 +- toolkit/library/Makefile.in | 4 - toolkit/library/libxul-config.mk | 7 +- toolkit/library/nsStaticXULComponents.cpp | 2 - toolkit/mozapps/installer/package-name.mk | 19 - toolkit/mozapps/installer/packager.mk | 6 +- .../profile/src/nsToolkitProfileService.cpp | 11 - toolkit/toolkit-makefiles.sh | 2 - toolkit/xre/Makefile.in | 3 - toolkit/xre/nsAppRunner.cpp | 25 - toolkit/xre/nsNativeAppSupportBeOS.cpp | 382 -- toolkit/xre/nsSigHandlers.cpp | 33 - toolkit/xre/nsUpdateDriver.cpp | 2 +- toolkit/xre/nsXREDirProvider.cpp | 19 +- uriloader/exthandler/Makefile.in | 7 - uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp | 93 - uriloader/exthandler/beos/nsMIMEInfoBeOS.h | 55 - .../exthandler/beos/nsOSHelperAppService.cpp | 264 -- .../exthandler/beos/nsOSHelperAppService.h | 71 - widget/public/Makefile.in | 4 - widget/public/nsIDragSessionBeOS.h | 61 - widget/src/Makefile.in | 2 +- widget/src/beos/Makefile.in | 94 - widget/src/beos/nsAppShell.cpp | 200 -- widget/src/beos/nsAppShell.h | 80 - widget/src/beos/nsBeOSCursors.h | 246 -- widget/src/beos/nsBidiKeyboard.cpp | 63 - widget/src/beos/nsBidiKeyboard.h | 56 - widget/src/beos/nsCList.h | 121 - widget/src/beos/nsChildView.cpp | 170 - widget/src/beos/nsChildView.h | 51 - widget/src/beos/nsClipboard.cpp | 336 -- widget/src/beos/nsClipboard.h | 71 - widget/src/beos/nsDeviceContextSpecB.cpp | 260 -- widget/src/beos/nsDeviceContextSpecB.h | 113 - widget/src/beos/nsDragService.cpp | 768 ---- widget/src/beos/nsDragService.h | 106 - widget/src/beos/nsFilePicker.cpp | 530 --- widget/src/beos/nsFilePicker.h | 161 - widget/src/beos/nsLookAndFeel.cpp | 418 --- widget/src/beos/nsLookAndFeel.h | 52 - widget/src/beos/nsPopupWindow.cpp | 183 - widget/src/beos/nsPopupWindow.h | 60 - widget/src/beos/nsPrintOptionsBeOS.cpp | 58 - widget/src/beos/nsPrintOptionsBeOS.h | 58 - widget/src/beos/nsPrintdBeOS.h | 90 - widget/src/beos/nsScreenBeOS.cpp | 132 - widget/src/beos/nsScreenBeOS.h | 58 - widget/src/beos/nsScreenManagerBeOS.cpp | 130 - widget/src/beos/nsScreenManagerBeOS.h | 65 - widget/src/beos/nsSound.cpp | 179 - widget/src/beos/nsSound.h | 60 - widget/src/beos/nsSwitchToUIThread.h | 120 - widget/src/beos/nsToolkit.cpp | 356 -- widget/src/beos/nsToolkit.h | 81 - widget/src/beos/nsWidgetFactory.cpp | 177 - widget/src/beos/nsWindow.cpp | 3176 ----------------- widget/src/beos/nsWindow.h | 341 -- widget/src/beos/nsdefs.h | 55 - widget/src/beos/resource.h | 38 - widget/src/xpwidgets/Makefile.in | 4 +- xpcom/base/nsDebugImpl.cpp | 11 +- xpcom/build/Makefile.in | 4 - xpcom/build/nsXPCOMPrivate.h | 11 +- xpcom/components/nsComponentManager.cpp | 6 - xpcom/components/nsNativeComponentLoader.cpp | 2 +- xpcom/ds/nsCRT.h | 2 +- xpcom/glue/nsCRTGlue.h | 2 +- xpcom/glue/nsGREGlue.cpp | 84 +- xpcom/glue/standalone/Makefile.in | 3 - xpcom/glue/standalone/nsGlueLinkingBeOS.cpp | 166 - xpcom/io/SpecialSystemDirectory.cpp | 64 +- xpcom/io/SpecialSystemDirectory.h | 13 +- xpcom/io/nsAppFileLocationProvider.cpp | 17 +- xpcom/io/nsDirectoryService.cpp | 47 - xpcom/io/nsDirectoryServiceAtomList.h | 3 - xpcom/io/nsDirectoryServiceDefs.h | 4 - xpcom/io/nsLocalFile.h | 2 +- xpcom/io/nsLocalFileCommon.cpp | 2 +- xpcom/io/nsLocalFileUnix.cpp | 109 +- xpcom/io/nsNativeCharsetUtils.cpp | 4 +- xpcom/io/nsNativeCharsetUtils.h | 4 +- xpcom/reflect/xptcall/src/md/unix/Makefile.in | 6 - .../src/md/unix/xptc_platforms_unixish_x86.h | 8 +- xulrunner/app/Makefile.in | 8 +- xulrunner/stub/nsXULStub.cpp | 16 - 149 files changed, 89 insertions(+), 13084 deletions(-) delete mode 100644 browser/app/apprunner-beos.rsrc delete mode 100644 gfx/src/thebes/nsSystemFontsBeOS.cpp delete mode 100644 gfx/src/thebes/nsSystemFontsBeOS.h delete mode 100644 gfx/thebes/gfxBeOSPlatform.cpp delete mode 100644 gfx/thebes/gfxBeOSPlatform.h delete mode 100644 gfx/thebes/gfxBeOSSurface.cpp delete mode 100644 gfx/thebes/gfxBeOSSurface.h delete mode 100644 intl/uconv/src/nsBeOSCharset.cpp delete mode 100644 modules/libpr0n/decoders/icon/beos/Makefile.in delete mode 100644 modules/libpr0n/decoders/icon/beos/nsIconChannel.cpp delete mode 100644 modules/libpr0n/decoders/icon/beos/nsIconChannel.h delete mode 100644 modules/plugin/base/src/nsPluginsDirBeOS.cpp delete mode 100644 toolkit/xre/nsNativeAppSupportBeOS.cpp delete mode 100644 uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp delete mode 100644 uriloader/exthandler/beos/nsMIMEInfoBeOS.h delete mode 100644 uriloader/exthandler/beos/nsOSHelperAppService.cpp delete mode 100644 uriloader/exthandler/beos/nsOSHelperAppService.h delete mode 100644 widget/public/nsIDragSessionBeOS.h delete mode 100644 widget/src/beos/Makefile.in delete mode 100644 widget/src/beos/nsAppShell.cpp delete mode 100644 widget/src/beos/nsAppShell.h delete mode 100644 widget/src/beos/nsBeOSCursors.h delete mode 100644 widget/src/beos/nsBidiKeyboard.cpp delete mode 100644 widget/src/beos/nsBidiKeyboard.h delete mode 100644 widget/src/beos/nsCList.h delete mode 100644 widget/src/beos/nsChildView.cpp delete mode 100644 widget/src/beos/nsChildView.h delete mode 100644 widget/src/beos/nsClipboard.cpp delete mode 100644 widget/src/beos/nsClipboard.h delete mode 100644 widget/src/beos/nsDeviceContextSpecB.cpp delete mode 100644 widget/src/beos/nsDeviceContextSpecB.h delete mode 100644 widget/src/beos/nsDragService.cpp delete mode 100644 widget/src/beos/nsDragService.h delete mode 100644 widget/src/beos/nsFilePicker.cpp delete mode 100644 widget/src/beos/nsFilePicker.h delete mode 100644 widget/src/beos/nsLookAndFeel.cpp delete mode 100644 widget/src/beos/nsLookAndFeel.h delete mode 100644 widget/src/beos/nsPopupWindow.cpp delete mode 100644 widget/src/beos/nsPopupWindow.h delete mode 100644 widget/src/beos/nsPrintOptionsBeOS.cpp delete mode 100644 widget/src/beos/nsPrintOptionsBeOS.h delete mode 100644 widget/src/beos/nsPrintdBeOS.h delete mode 100644 widget/src/beos/nsScreenBeOS.cpp delete mode 100644 widget/src/beos/nsScreenBeOS.h delete mode 100644 widget/src/beos/nsScreenManagerBeOS.cpp delete mode 100644 widget/src/beos/nsScreenManagerBeOS.h delete mode 100644 widget/src/beos/nsSound.cpp delete mode 100644 widget/src/beos/nsSound.h delete mode 100644 widget/src/beos/nsSwitchToUIThread.h delete mode 100644 widget/src/beos/nsToolkit.cpp delete mode 100644 widget/src/beos/nsToolkit.h delete mode 100644 widget/src/beos/nsWidgetFactory.cpp delete mode 100644 widget/src/beos/nsWindow.cpp delete mode 100644 widget/src/beos/nsWindow.h delete mode 100644 widget/src/beos/nsdefs.h delete mode 100644 widget/src/beos/resource.h delete mode 100644 xpcom/glue/standalone/nsGlueLinkingBeOS.cpp diff --git a/Makefile.in b/Makefile.in index 0c2cfff3adef..082e69d3eec2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -83,7 +83,7 @@ include $(topsrcdir)/config/config.mk GARBAGE_DIRS += dist _javagen _profile _tests staticlib DIST_GARBAGE = config.cache config.log config.status config-defs.h \ - dependencies.beos config/autoconf.mk \ + config/autoconf.mk \ unallmakefiles mozilla-config.h \ netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \ $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index d55bee0511e2..08ed9656045b 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -199,13 +199,6 @@ RCFLAGS += -DDEBUG endif endif -ifeq ($(OS_ARCH),BeOS) -BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc -ifdef BUILD_STATIC_LIBS -OS_LIBS += -ltracker -lgame -endif -endif - ifeq ($(OS_ARCH),OS2) RESFILE=splashos2.res RCFLAGS += -DMOZ_PHOENIX diff --git a/browser/app/apprunner-beos.rsrc b/browser/app/apprunner-beos.rsrc deleted file mode 100644 index 145e9ca36dfca8072be0b28e2c1c6c93b6dff813..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10792 zcmeHtbyQSs+wTxcx6%y`(karQ3?(TcH86B{w-VCbB?2;}NJ&U34Fb~A4bmXpaQ3Lr z_k8bp*Llx6XRYtQ=UQvezOViJUBBzPult@gv)A6LY9J5@Um0>2I6)8xV(|ZAh*%I1 zyMgjs!vg8|7;*U)FvRu$iLnSX2(%6eBlO>+fk3Fg(}2o>@n23k7BB|tL0CC92t@yT z2pR^)5B^*~#Q}k&DE3_0jM3#T_fA{*IKK#>%fA+vXd*Giv@c*_45dHeU8W;?o znep@Uo0$QF|D6m5&(8S45)zye5@3EaV5a|#0l+{gKyY#baKG~6!T&~p!@*2Iw4WcY z-yhr$^K9a80vvvaX?AuNce2qXS+P7#O6RR}D*m0hR!pnVBuV z`ilU-K0Z*Wk8TGhP#{79<_DXdgI-?+{Zjba0SC<2*SGhMA0ixKKnl#&tJQzSJ9>M^ z|6%|oG_9^81O|VFBjVv5fdRj9M2R!StE*=K-V5aaCGYF2ON4-dHXs@~TYh%-8~+3Q zq~-w-fCK0(&}H=BxbB~D#2hdX!hS$6W@r6o{={=2a5%iTw->YgH~xz-Gh5zt)&%5d z|Ahna(61i<5&$y+mIrM@wD1=WOsxZccLuOoAoVN)Mu7qb;2i7-d7#O@@WJncc~EHB z%nSfOEdPUV{T4uE0eX;{3J(InhYyic|KKI;zXSky3lQn(n41Mq6hLS~7y4@f*nbHi z`Uez=HaiPMGv^IK&#rZUuP`70hy%DU9EAzkg#cUvXkSnK4hLp{ARusH2~nAtkcaY8 zp-sU4_-lgz0)G)w{}`}#XMe$nDFVj!mj)c3+H?lMdBEiV*e?QtgqQ$4HMOa!37YyB zh&cZj;a9DQB>ycMLEuD0|FYlP0dehLZR>ABNAJHve|aScPH%6?U;h8#IXar~HjEIF zAS~ea12$oF)W_e|)5Yz-MLi7gXCEx-(J^ZW~@bmJ@{ff&0#w_$K90zD` z5Ww+8hxq~Dfa2R;-&APo*YC4{8?<^>cFW!IOJR0w5V|^13>3tPSP>r|Umv}*JPg1` z=R_=Js&A@Z@pr(zy~R2Ky3f|pJ2>{s1wO`5QBY8Rdxj1UHkQVQE|&IooF43Mb|xH( z_Fk4YHiqodmQJQ-_8uVar^?bu`sf6RfA`yH`XD4ERdqE<#4Q2hKH!dvr-P|8Cg8Z3 zdbn^}xY*i&a9>da{=X|fHRaGyRp2nQv@u0Q14acL|7V_y0|>Yi;R9oC|3^Iw7l7zu z@8k&r(flVp1kd^R%?s^+;@KKn+PK(*M2a1S|6^V|Q+H>Oi?auy1zK~Xw#F(i#=Ozd9nJg|I}Xp z$nr1)_HzFx&9@tei{qDmu6}&YzMe;8Z+%xJ^b{?HGavM&4e3mCuCaxaaW=J?CFX=om2vxmdc?&f)hy(PXF zw$OV2P;H7P=V#wQ3O_C(+vqucy=Gz0|xRKqSN|fQ$D8`PK`d-Cr*c3oYW#7 zX9w%yR#~^_2Nwqvy|u}wnKRx$e>RxgH;Z~XR!@sgU9p&4%~KAkeU@Pu3gRegDQ?tw zGa?yYUu%dy={kg?y($*`TG|&lwvjw5Y0*&l= zPdq=>6|ztB31rlp%G{Vc`^b0sw%?j|?JH62l`gxnYjB5 zt6xF*>4>9z%v1|%gtQF{2}!l7SL?%#vza&wD%cSpj!>HSRuP#^Xmx=P_bDIti!Hm! zxK9OTZ$&?Q)m*ZRag@z-P2YCyy}jAprXXsbq_mZzWQY=Bk|z-tn3YB2c&;UtHKh=X5!!exSu+>W=N<2F!5ZubXU&(yquxIh#^Vw*+Xwh)2$gLBCmBmZIgSp*e1wP$HKy>wuSElmKO&b z2%F!9H&Dj}DdG6fNtMZojZh>$I^eO=keMkc+h}%o4EZd_(ztriZ^bZu9f^Ba$L0s{$Y&}ZAf4 zT{&xYA}{EPjvJnlk~7Y=F)V-PfvZiXEcUxPju)v?dzyK9G7Z#!tTvrvcJ7`}-bm)L z+9+Kz^gcIRA{#ZH>ZUcdvnm)OC3R#U(3|V?kZGx%bn}6`|dLKNo-Smq{&)iWq3?XY0QM|Nk_;xw)5n$fEV!$Y1vba}I8 zWF#@D^g})Mj*iMkGe5nN0u>E~E6*`b)c9qq*E)MW!+_Q&m_RXs@?u^QG^muUE>UI? zo7jWbWI2d%T1cG?UB~WYo`Uh}Qmh$WO6?_Iaq|hu$m{VKk0x_8HdjSY8PbqV!c-ow z;o|zC5GmalUwV1uR~lj+q(=!{7ky*q#F4(XqNc+9yg8=eJht!=C8K*$$(0XvHk8sX zw6W}2%Z8S7XY$fo%@oGsx-^TQrD3#0y0%F}c%Ml|ty(8`)D+t;;`9-1CDe%2IKNm6 z)0dnDJwdm@f0L&WMHxcxbxs)ABI08DQUgFH<{`$Z4q8Yl_{$&e<4vfb-JH_Pkq(0jlTwNe^eq7W3Vvp!2(@;zI*Mgd=< zC8(8xhpE-3TpC9j3+Ko8o$HEMbJDxyhdNTFsRo|59WPs*c*M)257`unG><$V%^OaS ze;rxbpPxvk;5A-#73QXK9Zvnm#a?XBHRs0j;1G&QX}KFyyhK@p_vxE)^+A1ijyac9 zB+m;i>8WCL)~U$p?-Gwx%nj?lxR|&xRq}YUoJN*D91~o!EP>o7_s7)0!JvI(Q@Crc zXKHTC=t88&mBh54YT`DG3oVTvDR`D)d!H{3y2#DUgk)1d6y#OZ&b~n|ZH#lvFKqC%NO8-TtTw&F5DfUhfjW(*5)qcg6 zd8T5P(9(8I8?1I~)*xw@99EIeJgb#QQtB)0dZUzQX79{N{>pAdGRJVlA9@AQ$Db}ez2yiS8c;zrn}Jm z%U2SySi)SSC*Vi@j`mjzKCzW!fi-4q7a?FH#=A&i&?4drVw1T)apmPRI1zlKCh~enxX% znV!~WmL=gMKEY4-6Syk3{bNbC4(E);QPjk>rHMLec5yq3<;jJ&6UpvT$EoZaqf2%? zedz6DW-1@>SBiyYQ1^HPQr+MoNk=VFL+aO699HHf^oR`7Or^*!G{ zwlzFH>YvAqpt;Vbu?--Lul933de>Q52glX9=oFdCgH#c&V+C>+CUnjM^p%S5oBRH& zyd`$9KCc5tvFDp#SW+?EG&)YTQtKx-8ak`S$6=yZ4Q__M*GWM>9*ri|ZPsd*IvMnD zg{&Vk6|_?@=}Asu-Uz6NG#A2PjNsG=}m_a>5}5EXcEUS)EC zyrHOip+}2_N~?jH_o(vq>u==wuM_c2Qlm<=NbdBBCUG7uV3#GGgGLDHF~Gha?4?mz zruSLrC*8qD?D>b~*p4N<+AE>lgI?PMh1&xYcxy1$I2_3^rn+^y8U z%S#(&vvI#iYyDPMN1`q3fyiQ%A)(i-FdM`Ja@H*u*)H*Z1$jCw)1x1GiWj@30#6b& zg+s?hT!Z`QC>I(mv*+A>g71=zT^@8udF`AfN&0@gfX6`6fgA^ZZwOV7bo1%xbe00m zaqCf@1W(*-!gWqS7V4OveP2RWY*TZi6;FDEHt6G|n?-;tA;;G0%rtGZ zAu%u-fP+Oz4}!Evj`Ggn%@}V)24B+<6rc=Hh^OEy(X*hfaNs9B!HK;q&%aJM{ow=i zcnyXOf!Yv7D2!5V>Rl6oYA(vztB^h?%CGmIlRQBmMo&LC;)qIT2I;@jTrH|?vPzdv z-TcZB%t<(FaR*nwHuUj;@F#swF#Lyr0-1E#P*@eUE>hExhqy+ zo`;!xH$SA)H&(@}mT^Up49<;1?oVaVWG8XfIz} z^pCLFEcX7iCWu$r2K6H0kVPr#_`4E=gJCOavdIMy-m=%KS)pBtNh#fdMbdF4_2`k)54Y>JL?(8N--xd>1GV9ZvgBW!`4}mc zej<7;(SHYgpS>>E*<&j7h6Iasiv5F~nJ$|_?)fwqcUfSV3Kp}pf0#*^j|2ySK`x!K zqFK%YL`qHGY<*W^pKET!dsF0GrSQ~w@%;@D_wxw%Xc-XI?&BEIoxo?>_0Z+pP zHO;Qn!)uqi1VuZbWln!jBqY1_#w$!c=y_w)VsFclQx%f+)X(L7_83Y-c}BLSV6Cm^Z!LU^dphXwGARpb{fmptdrPKI z+wWOD8)nT#UqBYrVU%)hNOyG4|65B}3R0 zRx4`0`qUT82SWI_(mck_X|LHlPiov4hbb}n6*o@5S4b$wSPl}St zl%it@n-PbQ_>TxnDiuTotjdsyikii9mO=X1yM`G0F?3id)}N})Jz^Hx!ADC#%_~xn z5W~?%=27=gEZ8tbCE?SXn&1csQLU}>n)-G^UTUhD8v=6A$qsoHD$Q0nXUf+9sko-R zt2-kGZ!2j!u+n+(Mn%dA?c_bJ*5OJv!{VzjyHm6Sx|d&qr=zYv;cUi=FUV!ukK6HE zxf;|GoS%EMWOa-*Ob5IjiW{_y!8$rUWZXuz;WH;d{U(!`NqI0y{~}MW(2*dP)gZP= zFrJPi%2ZI196f9K(i2nMsD~IFgwj>r$UyatnP=sF%14^B!}pK8{g_@wKBjaGk%ZN& zENv2#eb8V^sDv!YkK3TJb)89_Zy3p1e+<+upyIN#@n%j1d%cwsj4k^5oj(ljs>{fhQm~t3D5liD>9}@12nK5}A}uAAB%(nB=|UXr5f^x2|J;zXG;- z5&1|q_x{E=Qs3vMxPqIVDL)_NbQkW?DLgd*?-iw9<%FY#p1x*w5+F_8H-u>_AGI7s zCoW}$n=d91lU4Ta6D6d37L-ewNg3^e89p;e^Qw%>$+37-t4qiRVhagpAZ=~0eE6g; zf?)z~|G+#D(e#2z{}xj#-dH@sCoO`4-R<#*@or5hE6j{b@COSFm#nhlYYG@^DZKdv zl`_DY2G$%PUvjpW5b^W^@5lL(f54h};Y}Cblg`OO12ykW9%B9-8%x43RbNOc%@Ty!Lfn+~`F6ZH_nJ32;8@xIF{=x}oLuT*9c z$K~sgxK>v)4mM+AYxfw4EoWSgk2=p~=1lSv_zO^7<30g1AXOuORQoZ5Wbe#GsttY0 z2(f7Wxe$kZ(w-_O}p$8TH`0r!?F(96Czy;f9of-e|I2SLDYQ#BIt#DKqZmiJ_k!xq)vcOCh1<$!QkTWi%myOQ zxS-Rhm4d0e2Ie7c~iFiQZo!FcA!Lx4;3fX^}{XBuDL-Gwn3L;WJOC{Wyl( z*(RgiL1Y&HCZ?Udb04hQz^-fLX>7;Y80=e;&z=IuZ_6IHo|9TJ%-74;EkO0{fe1~C zHCT9hRtN9B;OJxMV9}WGBh<7`VOc9$aP8TAM^Jp`sc~~ye8uUkF*j-UB!SnNkosbYkQfW2a{^!E+nW`)aPHh488WX ze6@Y+6eDOsYEUSG`|is(Mv`93drm(|+)66m2D1^5XwDBGIz4x=d;dcvWAxD~a_6Q$ zEox^L2e~c-E^Epqih>;*SFcRvr(%%zAeWZWksalI)E6Fi&>={@zm zGb0Wip7AuzUqRfxBh2}PL$-+pRca|36P&#rXcS)Tp7j4XhthyhE>NPr6>OogcR4(M z&HX?!=u5%9_{+t}BFj2~s5>5`W{mX|`#vIX_X$fWUB@Fp{HuCH{A2~QN|kGk+v-Xc z;pNLHylk=7ZXN|Ep*LP)N-U&ev=6jG%WcfSnhNcW)W$64i;AmG97f_a8J7lP5rL4G zuM^7@+P>u9s02ZEu|*fv_tG7J%?QFBONEFW?g(3Z`xn=GJ6v1VJF8pRqG5!$HaU&46W zZt2*5=RL;iq+9x#C*Ao?%Sz_wg>t*E-i~@zk(qXE3=L-Y(+1Kcytuw?c9)PO+BRfw zb4&#{oEYIOm-ZR_oX9o}M++RG&dlP+jV-)KbN3UO5*!AJy_O5#BQX&lcqZ=mmiE$9 z?9tjDk%_ps&!*BGL-))M-xylqo;cCRZ+{YQi2C>9aoebYpOtUh zk%>8mw!q^QbsK##tX&&1Sim?z8|MzOHrXNpig~1r_reogyU!yH-DInfzbUZPu2y6! ze+kdu4r=9p_Bh^hBpHwA3z?AGr>qbh-LG8~I{dl(N!KO?SuRB1sdGL;Yf1YLtfKUF zymf*@UbBa3mA;k84$3-(f*i|TTWZS2nD@e^UhX)j^a(|*b<;Em-^$=K`?pWkbJ<(UX^&l^r; ze6l*cE2sWcR&qH2Uy^)tZoslVIDVC4XHa%y@v~Q0 zpaQ!=*>hQB)>1imm})|a;-$Y{Q5;@%cCC9vr+sEPBMshuLj30&SnnWvnzV|_6T~Zo zhyxGwR7zP*=!uF7Oj_ZIjM}f4{1DGCm6Rpr5Kr8Yfdl_HNkK?W9Rib+R95<%B`K$f zU?JX={KHcGcb1x>oFXC_;zdWCzZ0s-$^4g)jEveZ%ALQ3q~#Q(VCvc`Qhyf()Z_&a V5HD^1mF~sArz0{j`t{iKe*y5JiFE(~ diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp index 8275c704ca29..eb7b7b847ab3 100644 --- a/browser/components/build/nsModule.cpp +++ b/browser/components/build/nsModule.cpp @@ -52,9 +52,7 @@ #ifndef WINCE #include "nsProfileMigrator.h" -#if !defined(XP_BEOS) #include "nsDogbertProfileMigrator.h" -#endif #if !defined(XP_OS2) #include "nsOperaProfileMigrator.h" #endif @@ -95,9 +93,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init) #ifndef WINCE -#if !defined(XP_BEOS) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator) -#endif #if !defined(XP_OS2) NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator) #endif @@ -143,9 +139,7 @@ NS_DEFINE_NAMED_CID(NS_ICABPROFILEMIGRATOR_CID); #if !defined(XP_OS2) NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID); #endif -#if !defined(XP_BEOS) NS_DEFINE_NAMED_CID(NS_DOGBERTPROFILEMIGRATOR_CID); -#endif NS_DEFINE_NAMED_CID(NS_PHOENIXPROFILEMIGRATOR_CID); NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID); #endif /* WINCE */ @@ -175,9 +169,7 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = { #if !defined(XP_OS2) { &kNS_OPERAPROFILEMIGRATOR_CID, false, NULL, nsOperaProfileMigratorConstructor }, #endif -#if !defined(XP_BEOS) { &kNS_DOGBERTPROFILEMIGRATOR_CID, false, NULL, nsDogbertProfileMigratorConstructor }, -#endif { &kNS_PHOENIXPROFILEMIGRATOR_CID, false, NULL, nsPhoenixProfileMigratorConstructor }, { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor }, #endif /* WINCE */ @@ -221,9 +213,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { #if !defined(XP_OS2) { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "opera", &kNS_OPERAPROFILEMIGRATOR_CID }, #endif -#if !defined(XP_BEOS) { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "dogbert", &kNS_DOGBERTPROFILEMIGRATOR_CID }, -#endif { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix", &kNS_PHOENIXPROFILEMIGRATOR_CID }, { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID }, #endif /* WINCE */ diff --git a/browser/components/migration/src/Makefile.in b/browser/components/migration/src/Makefile.in index ea9ffadf2c1a..33c595a22594 100644 --- a/browser/components/migration/src/Makefile.in +++ b/browser/components/migration/src/Makefile.in @@ -55,12 +55,9 @@ CPPSRCS = nsProfileMigrator.cpp \ nsNetscapeProfileMigratorBase.cpp \ nsSeamonkeyProfileMigrator.cpp \ nsPhoenixProfileMigrator.cpp \ + nsDogbertProfileMigrator.cpp \ $(NULL) -ifneq ($(OS_ARCH),BeOS) -CPPSRCS += nsDogbertProfileMigrator.cpp -endif - ifneq ($(OS_ARCH),OS2) CPPSRCS += nsOperaProfileMigrator.cpp endif diff --git a/browser/components/migration/src/nsOperaProfileMigrator.cpp b/browser/components/migration/src/nsOperaProfileMigrator.cpp index d3c9722663c4..8187e6c7c3a3 100644 --- a/browser/components/migration/src/nsOperaProfileMigrator.cpp +++ b/browser/components/migration/src/nsOperaProfileMigrator.cpp @@ -85,19 +85,11 @@ #define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini") #define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat") #define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr") -#elif defined (XP_BEOS) -#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera") -#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera.ini") -#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat") -#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera.adr") #else #error Need to define location of Opera Profile data. #endif #define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies4.dat") -#ifdef XP_BEOS -#define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies.dat") -#endif /////////////////////////////////////////////////////////////////////////////// // nsBrowserProfileMigrator diff --git a/browser/components/migration/src/nsPhoenixProfileMigrator.cpp b/browser/components/migration/src/nsPhoenixProfileMigrator.cpp index 7af1132272a9..57877093db8a 100644 --- a/browser/components/migration/src/nsPhoenixProfileMigrator.cpp +++ b/browser/components/migration/src/nsPhoenixProfileMigrator.cpp @@ -289,11 +289,6 @@ nsPhoenixProfileMigrator::FillProfileDataFromPhoenixRegistry() phoenixRegistry->Append(NS_LITERAL_STRING(".phoenix")); phoenixRegistry->Append(NS_LITERAL_STRING("appreg")); -#elif defined(XP_BEOS) - fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry)); - - phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix")); - phoenixRegistry->Append(NS_LITERAL_STRING("appreg")); #elif defined(XP_OS2) fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry)); diff --git a/browser/components/migration/src/nsProfileMigrator.cpp b/browser/components/migration/src/nsProfileMigrator.cpp index 73f615cdd338..ec3801e9724d 100644 --- a/browser/components/migration/src/nsProfileMigrator.cpp +++ b/browser/components/migration/src/nsProfileMigrator.cpp @@ -324,12 +324,6 @@ nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName) NS_ENSURE_SUCCESS(rv, PR_FALSE); regFile->AppendNative(aAppName); regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat")); -#elif defined(XP_BEOS) - rv = dirService->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), - getter_AddRefs(regFile)); - NS_ENSURE_SUCCESS(rv, PR_FALSE); - regFile->AppendNative(aAppName); - regFile->AppendNative(NS_LITERAL_CSTRING("appreg")); #else rv = dirService->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(regFile)); diff --git a/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp b/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp index 3c45e7a4fcc2..35eb877ef3f1 100644 --- a/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp +++ b/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp @@ -322,11 +322,6 @@ nsSeamonkeyProfileMigrator::FillProfileDataFromSeamonkeyRegistry() seamonkeyRegistry->Append(NS_LITERAL_STRING(".mozilla")); seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg")); -#elif defined(XP_BEOS) - fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry)); - - seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla")); - seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg")); #elif defined(XP_OS2) fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry)); diff --git a/build/unix/run-mozilla.sh b/build/unix/run-mozilla.sh index 8372064c308d..df09d775ba5b 100755 --- a/build/unix/run-mozilla.sh +++ b/build/unix/run-mozilla.sh @@ -333,12 +333,6 @@ LIBPATH=${MOZ_DIST_BIN}:${MRE_HOME}${LIBPATH:+":$LIBPATH"} ## Set DYLD_LIBRARY_PATH for Mac OS X (Darwin) DYLD_LIBRARY_PATH=${MOZ_DIST_BIN}:${MRE_HOME}${DYLD_LIBRARY_PATH:+":$DYLD_LIBRARY_PATH"} # -## Set LIBRARY_PATH for BeOS -LIBRARY_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/components:${MRE_HOME}${LIBRARY_PATH:+":$LIBRARY_PATH"} -# -## Set ADDON_PATH for BeOS -ADDON_PATH=${MOZ_DIST_BIN}${ADDON_PATH:+":$ADDON_PATH"} -# ## Solaris Xserver(Xsun) tuning - use shared memory transport if available if [ "$XSUNTRANSPORT" = "" ] then diff --git a/config/config.mk b/config/config.mk index 037543f3d003..9fb57b95a533 100644 --- a/config/config.mk +++ b/config/config.mk @@ -130,9 +130,6 @@ else LD := $(CC) endif endif -ifeq ($(OS_ARCH),BeOS) -BEOS_ADDON_WORKAROUND = 1 -endif # # Strip off the excessively long version numbers on these platforms, diff --git a/config/rules.mk b/config/rules.mk index e28cabca2f72..afe5ca33e4d2 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -914,9 +914,6 @@ ifndef NO_COMPONENTS_MANIFEST @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest "manifest components/components.manifest" @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.manifest "binary-component $(SHARED_LIBRARY)" endif -ifdef BEOS_ADDON_WORKAROUND - ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) -endif else # ! IS_COMPONENT ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) $(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib @@ -924,9 +921,6 @@ else $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib endif $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) -ifdef BEOS_ADDON_WORKAROUND - ( cd $(FINAL_TARGET) && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) -endif endif # IS_COMPONENT endif # SHARED_LIBRARY ifdef PROGRAM @@ -1060,12 +1054,6 @@ endif ifdef MOZ_POST_PROGRAM_COMMAND $(MOZ_POST_PROGRAM_COMMAND) $@ endif -ifeq ($(OS_ARCH),BeOS) -ifdef BEOS_PROGRAM_RESOURCE - xres -o $@ $(BEOS_PROGRAM_RESOURCE) - mimeset $@ -endif -endif # BeOS $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) ifeq (WINCE,$(OS_ARCH)) diff --git a/configure.in b/configure.in index f1cfd38de115..688d4bd5ad49 100644 --- a/configure.in +++ b/configure.in @@ -1841,12 +1841,6 @@ dnl ======================================================== dnl System overrides of the defaults for host dnl ======================================================== case "$host" in -*-beos*) - HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11" - HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"' - HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" - ;; - *mingw*|*wince|*winmo) if test -n "$_WIN32_MSVC"; then HOST_AR=lib @@ -1989,24 +1983,6 @@ case "$target" in AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) ;; -*-beos*) - no_x=yes - MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@' - _PLATFORM_DEFAULT_TOOLKIT="cairo-beos" - DSO_LDOPTS='-nostart' - TK_LIBS='-lbe -lroot' - LIBS="$LIBS -lbe" - if test "$COMPILE_ENVIRONMENT"; then - AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind") - AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta") - fi - _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar" - _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar" - _MOZ_USE_RTTI=1 - USE_DEPENDENT_LIBS= - MOZ_USER_DIR="Mozilla" - ;; - *-bsdi*) dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2) _PEDANTIC= @@ -3374,16 +3350,14 @@ case $target in esac dnl We don't want to link with libdl even if it's present on OS X, since -dnl it's not used and not part of the default installation. -dnl The same goes for BeOS. OS/2 has dlfcn in libc. +dnl it's not used and not part of the default installation. OS/2 has dlfcn +dnl in libc. dnl We don't want to link against libm or libpthread on Darwin since dnl they both are just symlinks to libSystem and explicitly linking dnl against libSystem causes issues when debugging (see bug 299601). case $target in *-darwin*) ;; -*-beos*) - ;; *-os2*) ;; *) @@ -5123,7 +5097,6 @@ MOZ_ARG_HEADER(Toolkit Options) [ --enable-default-toolkit=TK Select default toolkit Platform specific defaults: - BeOS - cairo-beos Mac OS X - cairo-cocoa Neutrino/QNX - photon OS/2 - cairo-os2 @@ -5140,7 +5113,6 @@ MOZ_ARG_HEADER(Toolkit Options) -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \ -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \ -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \ - -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \ -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \ -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \ -o "$_DEFAULT_TOOLKIT" = "cairo-android" @@ -5226,13 +5198,6 @@ cairo-qt) MOZ_PDF_PRINTING=1 ;; -cairo-beos) - MOZ_WIDGET_TOOLKIT=beos - USE_FC_FREETYPE=1 - TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)' - TK_LIBS='$(MOZ_CAIRO_LIBS)' - ;; - cairo-os2) MOZ_WIDGET_TOOLKIT=os2 USE_FC_FREETYPE=1 @@ -8679,12 +8644,6 @@ if test "$MOZ_TREE_CAIRO"; then CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include" CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg" fi - if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then - PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2) - BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1" - FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" - MOZ_ENABLE_CAIRO_FT=1 - fi if test "$USE_FC_FREETYPE"; then FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1" fi @@ -8714,7 +8673,6 @@ if test "$MOZ_TREE_CAIRO"; then AC_SUBST(XCB_SURFACE_FEATURE) AC_SUBST(WIN32_SURFACE_FEATURE) AC_SUBST(OS2_SURFACE_FEATURE) - AC_SUBST(BEOS_SURFACE_FEATURE) AC_SUBST(DIRECTFB_SURFACE_FEATURE) AC_SUBST(FT_FONT_FEATURE) AC_SUBST(FC_FONT_FEATURE) @@ -9329,9 +9287,7 @@ fi dnl Set various defines and substitutions dnl ======================================================== -if test "$OS_ARCH" = "BeOS"; then - AC_DEFINE(XP_BEOS) -elif test "$OS_ARCH" = "Darwin"; then +if test "$OS_ARCH" = "Darwin"; then AC_DEFINE(XP_UNIX) AC_DEFINE(UNIX_ASYNC_DNS) elif test "$OS_ARCH" = "OpenVMS"; then diff --git a/db/mork/src/morkConfig.h b/db/mork/src/morkConfig.h index b324192d97a6..f45267fcdcfb 100644 --- a/db/mork/src/morkConfig.h +++ b/db/mork/src/morkConfig.h @@ -68,13 +68,9 @@ #define MORK_UNIX 1 #endif -#ifdef XP_BEOS -#define MORK_BEOS 1 -#endif - // } %%%%% end platform defs peculiar to Mork %%%%% -#if defined(MORK_WIN) || defined(MORK_UNIX) || defined(MORK_MAC) || defined(MORK_BEOS) || defined(MORK_OS2) +#if defined(MORK_WIN) || defined(MORK_UNIX) || defined(MORK_MAC) || defined(MORK_OS2) #include #include #include @@ -143,10 +139,10 @@ FILE* mork_fileopen(const char* name, const char* mode); # define mork_kNewline "\015\012" # define mork_kNewlineSize 2 # else -# if defined(MORK_UNIX) || defined(MORK_BEOS) +# if defined(MORK_UNIX) # define mork_kNewline "\012" # define mork_kNewlineSize 1 -# endif /* MORK_UNIX || MORK_BEOS */ +# endif /* MORK_UNIX */ # endif /* MORK_WIN */ #endif /* MORK_MAC */ @@ -161,7 +157,7 @@ extern void mork_assertion_signal(const char* inMessage); // { %%%%% begin standard c utility methods %%%%% -#if defined(MORK_WIN) || defined(MORK_UNIX) || defined(MORK_MAC) || defined(MORK_BEOS) || defined(MORK_OS2) +#if defined(MORK_WIN) || defined(MORK_UNIX) || defined(MORK_MAC) || defined(MORK_OS2) #define MORK_USE_C_STDLIB 1 #endif /*MORK_WIN*/ diff --git a/db/mork/src/morkFile.cpp b/db/mork/src/morkFile.cpp index 766f2159933d..74a2bf0edaa1 100644 --- a/db/mork/src/morkFile.cpp +++ b/db/mork/src/morkFile.cpp @@ -261,11 +261,11 @@ morkFile::NewFileErrnoError(morkEnv* ev) const "\015\012\015\012\015\012\015\012\015\012\015\012\015\012\015\012"; # define morkFile_kNewlinesCount 8 # else -# if defined(MORK_UNIX) || defined(MORK_BEOS) +# ifdef MORK_UNIX static const char morkFile_kNewlines[] = "\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012"; # define morkFile_kNewlinesCount 16 -# endif /* MORK_UNIX || MORK_BEOS */ +# endif /* MORK_UNIX */ # endif /* MORK_WIN */ #endif /* MORK_MAC */ diff --git a/db/mork/src/morkStream.cpp b/db/mork/src/morkStream.cpp index cd8a6a75fc65..8b108d1104d4 100644 --- a/db/mork/src/morkStream.cpp +++ b/db/mork/src/morkStream.cpp @@ -327,12 +327,12 @@ morkStream::PutLineBreak(morkEnv* ev) return 2; # else -# if defined(MORK_UNIX) || defined(MORK_BEOS) +# ifdef MORK_UNIX this->Putc(ev, mork_kLF); return 1; -# endif /* MORK_UNIX || MORK_BEOS */ +# endif /* MORK_UNIX */ # endif /* MORK_WIN */ #endif /* MORK_MAC */ } diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index 508c29aad6b8..4ad19d8c8121 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -607,7 +607,7 @@ nsresult nsDefaultURIFixup::ConvertFileToStringURI(const nsACString& aIn, { attemptFixup = PR_TRUE; } -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) // Check if it starts with / (UNIX) if(aIn.First() == '/') { diff --git a/gfx/src/nsIRenderingContext.h b/gfx/src/nsIRenderingContext.h index da063af6f843..343a09e80dfa 100644 --- a/gfx/src/nsIRenderingContext.h +++ b/gfx/src/nsIRenderingContext.h @@ -450,7 +450,7 @@ public: NS_IMETHOD GetTextDimensions(const PRUnichar* aString, PRUint32 aLength, nsTextDimensions& aDimensions, PRInt32* aFontID = nsnull) = 0; -#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS) +#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) /** * Given an available width and an array of break points, * returns the dimensions (in app units) of the text that fit and diff --git a/gfx/src/thebes/Makefile.in b/gfx/src/thebes/Makefile.in index 825b15cd2167..b2b02043aaf6 100644 --- a/gfx/src/thebes/Makefile.in +++ b/gfx/src/thebes/Makefile.in @@ -89,10 +89,6 @@ CPPSRCS += nsSystemFontsOS2.cpp \ $(NULL) endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -CPPSRCS += nsSystemFontsBeOS.cpp -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) CMMSRCS = nsSystemFontsMac.mm endif diff --git a/gfx/src/thebes/nsSystemFontsBeOS.cpp b/gfx/src/thebes/nsSystemFontsBeOS.cpp deleted file mode 100644 index 9d410fbccb34..000000000000 --- a/gfx/src/thebes/nsSystemFontsBeOS.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* vim: set sw=2 sts=2 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS system font code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Parts of this file used to live in nsDeviceContextBeos.cpp. The Original - * Author of that code is Netscape Communications Corporation. - * - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include - -#include "nsIDeviceContext.h" -#include "nsSystemFontsBeOS.h" - -nsSystemFontsBeOS::nsSystemFontsBeOS() - : mDefaultFontName(NS_LITERAL_STRING("sans-serif")) - , mMenuFontName(NS_LITERAL_STRING("sans-serif")) - , mCaptionFontName(NS_LITERAL_STRING("sans-serif")) -{ - menu_info info; - get_menu_info(&info); - BFont menuFont; - menuFont.SetFamilyAndStyle(info.f_family, info.f_style); - menuFont.SetSize(info.font_size); - - GetSystemFontInfo(be_plain_font, &mDefaultFontName, &mDefaultFontStyle); - GetSystemFontInfo(be_bold_font, &mCaptionFontName, &mCaptionFontStyle); - GetSystemFontInfo(&menuFont, &mMenuFontName, &mMenuFontStyle); -} - -nsresult nsSystemFontsBeOS::GetSystemFont(nsSystemFontID aID, - nsString *aFontName, - gfxFontStyle *aFontStyle) const -{ - switch (aID) { - case eSystemFont_PullDownMenu: - case eSystemFont_Menu: - *aFontName = mMenuFontName; - *aFontStyle = mMenuFontStyle; - return NS_OK; - case eSystemFont_Caption: // css2 bold - *aFontName = mCaptionFontName; - *aFontStyle = mCaptionFontStyle; - return NS_OK; - case eSystemFont_List: - case eSystemFont_Field: - case eSystemFont_Icon : - case eSystemFont_MessageBox : - case eSystemFont_SmallCaption : - case eSystemFont_StatusBar : - case eSystemFont_Window: // css3 - case eSystemFont_Document: - case eSystemFont_Workspace: - case eSystemFont_Desktop: - case eSystemFont_Info: - case eSystemFont_Dialog: - case eSystemFont_Button: - case eSystemFont_Tooltips: // moz - case eSystemFont_Widget: - default: - *aFontName = mDefaultFontName; - *aFontStyle = mDefaultFontStyle; - return NS_OK; - } - NS_NOTREACHED("huh?"); -} - -nsresult -nsSystemFontsBeOS::GetSystemFontInfo(const BFont *theFont, nsString *aFontName, - gfxFontStyle *aFontStyle) const -{ - - aFontStyle->style = FONT_STYLE_NORMAL; - aFontStyle->weight = FONT_WEIGHT_NORMAL; - aFontStyle->decorations = FONT_DECORATION_NONE; - aFontStyle->stretch = NS_FONT_STRETCH_NORMAL; - - font_family family; - theFont->GetFamilyAndStyle(&family, NULL); - - uint16 face = theFont->Face(); - CopyUTF8toUTF16(family, *aFontName); - aFontStyle->size = theFont->Size(); - - if (face & B_ITALIC_FACE) - aFontStyle->style = FONT_STYLE_ITALIC; - - if (face & B_BOLD_FACE) - aFontStyle->weight = FONT_WEIGHT_BOLD; - - // FIXME: Set aFontStyle->stretch correctly! - - if (face & B_UNDERSCORE_FACE) - aFontStyle->decorations |= FONT_DECORATION_UNDERLINE; - - if (face & B_STRIKEOUT_FACE) - aFontStyle->decorations |= FONT_DECORATION_STRIKEOUT; - - aFontStyle->systemFont = PR_TRUE; - - return NS_OK; -} - diff --git a/gfx/src/thebes/nsSystemFontsBeOS.h b/gfx/src/thebes/nsSystemFontsBeOS.h deleted file mode 100644 index 30244e916651..000000000000 --- a/gfx/src/thebes/nsSystemFontsBeOS.h +++ /dev/null @@ -1,76 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS system font code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef _NS_SYSTEMFONTSBEOS_H_ -#define _NS_SYSTEMFONTSBEOS_H_ - -#include - -class BFont; - -class nsSystemFontsBeOS -{ -public: - nsSystemFontsBeOS(); - - nsresult GetSystemFont(nsSystemFontID anID, nsString *aFontName, - gfxFontStyle *aFontStyle) const; - -private: - nsresult GetSystemFontInfo(const BFont *theFont, nsString *aFontName, - gfxFontStyle *aFontStyle) const; - - /* - * The following system font constants exist: - * - * css2: http://www.w3.org/TR/REC-CSS2/fonts.html#x27 - * eSystemFont_Caption, eSystemFont_Icon, eSystemFont_Menu, - * eSystemFont_MessageBox, eSystemFont_SmallCaption, - * eSystemFont_StatusBar, - * // css3 - * eSystemFont_Window, eSystemFont_Document, - * eSystemFont_Workspace, eSystemFont_Desktop, - * eSystemFont_Info, eSystemFont_Dialog, - * eSystemFont_Button, eSystemFont_PullDownMenu, - * eSystemFont_List, eSystemFont_Field, - * // moz - * eSystemFont_Tooltips, eSystemFont_Widget - */ - nsString mDefaultFontName, mMenuFontName, mCaptionFontName; - gfxFontStyle mDefaultFontStyle, mMenuFontStyle, mCaptionFontStyle; -}; - -#endif /* _NS_SYSTEMFONTSBEOS_H_ */ diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp index 2dc92f1de768..acb8ac0ff5e7 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -77,9 +77,6 @@ static nsSystemFontsWin *gSystemFonts = nsnull; #include "nsSystemFontsOS2.h" #include "gfxPDFSurface.h" static nsSystemFontsOS2 *gSystemFonts = nsnull; -#elif defined(XP_BEOS) -#include "nsSystemFontsBeOS.h" -static nsSystemFontsBeOS *gSystemFonts = nsnull; #elif XP_MACOSX #include "nsSystemFontsMac.h" #include "gfxQuartzSurface.h" @@ -809,8 +806,6 @@ nsThebesDeviceContext::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const gSystemFonts = new nsSystemFontsWin(); #elif XP_OS2 gSystemFonts = new nsSystemFontsOS2(); -#elif defined(XP_BEOS) - gSystemFonts = new nsSystemFontsBeOS(); #elif XP_MACOSX gSystemFonts = new nsSystemFontsMac(); #elif defined(MOZ_WIDGET_QT) diff --git a/gfx/src/thebes/nsThebesRenderingContext.cpp b/gfx/src/thebes/nsThebesRenderingContext.cpp index e5bd4aa71326..735f40400b65 100644 --- a/gfx/src/thebes/nsThebesRenderingContext.cpp +++ b/gfx/src/thebes/nsThebesRenderingContext.cpp @@ -990,7 +990,7 @@ nsThebesRenderingContext::GetTextDimensions(const PRUnichar* aString, return NS_OK; } -#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS) +#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) NS_IMETHODIMP nsThebesRenderingContext::GetTextDimensions(const char* aString, PRInt32 aLength, @@ -1311,7 +1311,7 @@ nsThebesRenderingContext::GetTextDimensionsInternal(const PRUnichar* aString, return GetWidth(aString, aLength, aDimensions.width, aFontID); } -#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS) || defined(XP_MACOSX) || defined (MOZ_DFB) +#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_MACOSX) || defined (MOZ_DFB) nsresult nsThebesRenderingContext::GetTextDimensionsInternal(const char* aString, PRInt32 aLength, diff --git a/gfx/src/thebes/nsThebesRenderingContext.h b/gfx/src/thebes/nsThebesRenderingContext.h index c9450106deb8..0c75f43c73e6 100644 --- a/gfx/src/thebes/nsThebesRenderingContext.h +++ b/gfx/src/thebes/nsThebesRenderingContext.h @@ -92,7 +92,7 @@ public: NS_IMETHOD GetTextDimensions(const PRUnichar* aString, PRUint32 aLength, nsTextDimensions& aDimensions, PRInt32* aFontID = nsnull); -#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS) +#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) NS_IMETHOD GetTextDimensions(const char* aString, PRInt32 aLength, PRInt32 aAvailWidth, diff --git a/gfx/thebes/Makefile.in b/gfx/thebes/Makefile.in index e90fc2a0d990..531c78b03e21 100644 --- a/gfx/thebes/Makefile.in +++ b/gfx/thebes/Makefile.in @@ -63,16 +63,6 @@ EXPORTS += \ $(NULL) endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -EXPORTS += \ - gfxBeOSPlatform.h \ - gfxBeOSSurface.h \ - gfxFT2FontBase.h \ - gfxPDFSurface.h \ - gfxPangoFonts.h \ - $(NULL) -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) EXPORTS += \ gfxPlatformMac.h \ @@ -368,17 +358,6 @@ CPPSRCS += gfxPDFSurface.cpp EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS) $(ZLIB_LIBS) $(XLDFLAGS) $(XLIBS) $(CAIRO_FT_LIBS) $(XEXT_LIBS) endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -CPPSRCS += gfxBeOSSurface.cpp gfxBeOSPlatform.cpp -CPPSRCS += gfxPangoFonts.cpp -CPPSRCS += gfxFT2FontBase.cpp -CPPSRCS += gfxFT2Utils.cpp -#CPPSRCS += gfxPDFSurface.cpp -CPPSRCS += gfxFontconfigUtils.cpp -CPPSRCS += nsUnicodeRange.cpp -EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS) $(CAIRO_FT_LIBS) -lfontconfig -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) CPPSRCS += \ gfxQuartzSurface.cpp \ @@ -474,10 +453,6 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) CXXFLAGS += $(MOZ_PANGO_CFLAGS) endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -CXXFLAGS += $(CAIRO_FT_CFLAGS) -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),os2) CXXFLAGS += $(CAIRO_FT_CFLAGS) endif diff --git a/gfx/thebes/gfxBeOSPlatform.cpp b/gfx/thebes/gfxBeOSPlatform.cpp deleted file mode 100644 index a5d715a69e9f..000000000000 --- a/gfx/thebes/gfxBeOSPlatform.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Masayuki Nakano - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "gfxBeOSPlatform.h" -#include "gfxFontconfigUtils.h" -#include "gfxPangoFonts.h" - -#include "gfxImageSurface.h" -#include "gfxBeOSSurface.h" - -#include "nsTArray.h" - -gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull; - -gfxBeOSPlatform::gfxBeOSPlatform() -{ - if (!sFontconfigUtils) - sFontconfigUtils = gfxFontconfigUtils::GetFontconfigUtils(); -} - -gfxBeOSPlatform::~gfxBeOSPlatform() -{ - gfxFontconfigUtils::Shutdown(); - sFontconfigUtils = nsnull; - - gfxPangoFontGroup::Shutdown(); - -#if 0 - // It would be nice to do this (although it might need to be after - // the cairo shutdown that happens in ~gfxPlatform). It even looks - // idempotent. But it has fatal assertions that fire if stuff is - // leaked, and we hit them. - FcFini(); -#endif -} - -already_AddRefed -gfxBeOSPlatform::CreateOffscreenSurface (PRUint32 width, - PRUint32 height, - gfxASurface::gfxContentType contentType) -{ - gfxASurface *newSurface = nsnull; - - if (contentType == gfxASurface::CONTENT_ALPHA) { - newSurface = new gfxImageSurface(imageFormat, width, height); - } else { - newSurface = new gfxBeOSSurface(width, height, - contentType == gfxASurface::CONTENT_COLOR_ALPHA ? B_RGBA32 : B_RGB32); - } - - NS_ADDREF(newSurface); - return newSurface; -} - -nsresult -gfxBeOSPlatform::GetFontList(nsIAtom *aLangGroup, - const nsACString& aGenericFamily, - nsTArray& aListOfFonts) -{ - return sFontconfigUtils->GetFontList(aLangGroup, aGenericFamily, - aListOfFonts); -} - -nsresult -gfxBeOSPlatform::UpdateFontList() -{ - return sFontconfigUtils->UpdateFontList(); -} - -nsresult -gfxBeOSPlatform::ResolveFontName(const nsAString& aFontName, - FontResolverCallback aCallback, - void *aClosure, - PRBool& aAborted) -{ - return sFontconfigUtils->ResolveFontName(aFontName, aCallback, - aClosure, aAborted); -} - -nsresult -gfxBeOSPlatform::GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName) -{ - return sFontconfigUtils->GetStandardFamilyName(aFontName, aFamilyName); -} diff --git a/gfx/thebes/gfxBeOSPlatform.h b/gfx/thebes/gfxBeOSPlatform.h deleted file mode 100644 index 1580821b6907..000000000000 --- a/gfx/thebes/gfxBeOSPlatform.h +++ /dev/null @@ -1,76 +0,0 @@ -/* vim:set sw=4 sts=4 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#ifndef GFX_PLATFORM_BEOS_H -#define GFX_PLATFORM_BEOS_H - -#include "gfxPlatform.h" -#include "gfxTArray.h" - -class gfxFontconfigUtils; - -class NS_EXPORT gfxBeOSPlatform : public gfxPlatform { -public: - gfxBeOSPlatform(); - virtual ~gfxBeOSPlatform(); - - static gfxBeOSPlatform *GetPlatform() { - return (gfxBeOSPlatform*) gfxPlatform::GetPlatform(); - } - - already_AddRefed - CreateOffscreenSurface(PRUint32 width, - PRUint32 height, - gfxASurface::gfxContentType contentType); - - nsresult GetFontList(nsIAtom *aLangGroup, - const nsACString& aGenericFamily, - nsTArray& aListOfFonts); - - nsresult UpdateFontList(); - - nsresult ResolveFontName(const nsAString& aFontName, - FontResolverCallback aCallback, - void *aClosure, PRBool& aAborted); - - nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName); -protected: - static gfxFontconfigUtils *sFontconfigUtils; -}; - -#endif /* GFX_PLATFORM_BEOS_H */ diff --git a/gfx/thebes/gfxBeOSSurface.cpp b/gfx/thebes/gfxBeOSSurface.cpp deleted file mode 100644 index a4767f870a62..000000000000 --- a/gfx/thebes/gfxBeOSSurface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* vim:set sw=4 sts=4 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#include - -#include "gfxBeOSSurface.h" - -gfxBeOSSurface::gfxBeOSSurface(BView* aView) : - mOwnsView(PR_FALSE), mView(aView), mBitmap(nsnull) -{ - Init(cairo_beos_surface_create(aView)); -} - -gfxBeOSSurface::gfxBeOSSurface(BView* aView, BBitmap* aBitmap) : - mOwnsView(PR_FALSE), mView(aView), mBitmap(nsnull) -{ - Init(cairo_beos_surface_create_for_bitmap(aView, aBitmap)); -} - -gfxBeOSSurface::gfxBeOSSurface(unsigned long width, unsigned long height, color_space space) -{ - BRect bounds(0.0, 0.0, width - 1, height - 1); - mBitmap = new BBitmap(bounds, space, true); - mView = new BView(bounds, "Mozilla Bitmap view", B_FOLLOW_ALL_SIDES, 0); - mBitmap->AddChild(mView); - - mOwnsView = PR_TRUE; - Init(cairo_beos_surface_create_for_bitmap(mView, mBitmap)); -} - -gfxBeOSSurface::~gfxBeOSSurface() -{ - if (mOwnsView) { - mBitmap->RemoveChild(mView); - - delete mView; - delete mBitmap; - } -} diff --git a/gfx/thebes/gfxBeOSSurface.h b/gfx/thebes/gfxBeOSSurface.h deleted file mode 100644 index 0d088af43664..000000000000 --- a/gfx/thebes/gfxBeOSSurface.h +++ /dev/null @@ -1,59 +0,0 @@ -/* vim:set sw=4 sts=4 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is BeOS code in Thebes. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#ifndef GFX_BEOSSURFACE_H -#define GFX_BEOSSURFACE_H - -#include "gfxASurface.h" - -#include - -class gfxBeOSSurface : public gfxASurface { -public: - gfxBeOSSurface(BView* aView); - gfxBeOSSurface(BView* aView, BBitmap* aBitmap); - gfxBeOSSurface(unsigned long width, unsigned long height, color_space space = B_RGBA32); - virtual ~gfxBeOSSurface(); - -private: - PRBool mOwnsView; - BView* mView; - BBitmap* mBitmap; -}; - -#endif /* GFX_BEOSSURFACE_H */ diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index d6371ca1f793..3978a7621159 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -50,8 +50,6 @@ #include "gfxPlatformGtk.h" #elif defined(MOZ_WIDGET_QT) #include "gfxQtPlatform.h" -#elif defined(XP_BEOS) -#include "gfxBeOSPlatform.h" #elif defined(XP_OS2) #include "gfxOS2Platform.h" #elif defined(ANDROID) @@ -270,8 +268,6 @@ gfxPlatform::Init() gPlatform = new gfxPlatformGtk; #elif defined(MOZ_WIDGET_QT) gPlatform = new gfxQtPlatform; -#elif defined(XP_BEOS) - gPlatform = new gfxBeOSPlatform; #elif defined(XP_OS2) gPlatform = new gfxOS2Platform; #elif defined(ANDROID) diff --git a/intl/locale/src/nsLocaleConstructors.h b/intl/locale/src/nsLocaleConstructors.h index f2dd3aab65f2..312699ed7baf 100644 --- a/intl/locale/src/nsLocaleConstructors.h +++ b/intl/locale/src/nsLocaleConstructors.h @@ -52,7 +52,7 @@ #define USE_MAC_LOCALE #endif -#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) +#if defined(XP_UNIX) && !defined(XP_MACOSX) #define USE_UNIX_LOCALE #endif diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp index bd4f0f5498b5..bebd7dd3eb5d 100644 --- a/intl/locale/src/nsLocaleService.cpp +++ b/intl/locale/src/nsLocaleService.cpp @@ -62,7 +62,7 @@ #elif defined(XP_MACOSX) # include # include "nsIMacLocale.h" -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) # include # include # include "nsIPosixLocale.h" @@ -84,7 +84,7 @@ const char* LocaleList[LocaleListLength] = #define NSILOCALE_MAX_ACCEPT_LANGUAGE 16 #define NSILOCALE_MAX_ACCEPT_LENGTH 18 -#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) || defined(XP_OS2) +#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_OS2) static int posix_locale_category[LocaleListLength] = { LC_COLLATE, @@ -167,7 +167,7 @@ nsLocaleService::nsLocaleService(void) if (NS_FAILED(result)) { return;} } #endif -#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) +#if defined(XP_UNIX) && !defined(XP_MACOSX) nsCOMPtr posixConverter = do_GetService(NS_POSIXLOCALE_CONTRACTID); nsAutoString xpLocale, platformLocale; @@ -218,7 +218,7 @@ nsLocaleService::nsLocaleService(void) mApplicationLocale = do_QueryInterface(resultLocale); } // if ( NS_SUCCEEDED )... -#endif // XP_UNIX || XP_BEOS +#endif // XP_UNIX #ifdef XP_OS2 nsCOMPtr os2Converter = do_GetService(NS_OS2LOCALE_CONTRACTID); nsAutoString xpLocale; @@ -322,7 +322,7 @@ nsLocaleService::NewLocale(const nsAString &aLocale, nsILocale **_retval) nsString category; category.AssignWithConversion(LocaleList[i]); result = resultLocale->AddCategory(category, aLocale); if (NS_FAILED(result)) return result; -#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) +#if defined(XP_UNIX) && !defined(XP_MACOSX) category.AppendLiteral("##PLATFORM"); result = resultLocale->AddCategory(category, aLocale); if (NS_FAILED(result)) return result; diff --git a/intl/uconv/src/Makefile.in b/intl/uconv/src/Makefile.in index c0a55c32e43f..e208dbf338cd 100644 --- a/intl/uconv/src/Makefile.in +++ b/intl/uconv/src/Makefile.in @@ -102,9 +102,6 @@ else ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) CPPSRCS += nsMacCharset.cpp else -ifeq ($(OS_ARCH),BeOS) -CPPSRCS += nsBeOSCharset.cpp -else CPPSRCS += nsUNIXCharset.cpp endif endif diff --git a/intl/uconv/src/nsBeOSCharset.cpp b/intl/uconv/src/nsBeOSCharset.cpp deleted file mode 100644 index 05ae1866d193..000000000000 --- a/intl/uconv/src/nsBeOSCharset.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Sergei Dolgov (sergei_d@fi.tartu.ee); Tartu University - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIPlatformCharset.h" -#include "nsReadableUtils.h" -#include "nsPlatformCharset.h" - -// In BeOS, each window runs in its own thread. Because of this, -// we have a proxy layer between the mozilla UI thread, and calls made -// within the window's thread via CallMethod(). However, since the windows -// are still running in their own thread, and reference counting takes place within -// that thread, we need to reference and de-reference outselves atomically. -// See BugZilla Bug# 92793 -NS_IMPL_THREADSAFE_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset) - -nsPlatformCharset::nsPlatformCharset() -{ - mCharset.AssignLiteral("UTF-8"); -} - -nsPlatformCharset::~nsPlatformCharset() -{ -} - -NS_IMETHODIMP -nsPlatformCharset::GetCharset(nsPlatformCharsetSel selector, nsACString& aResult) -{ - aResult = mCharset; - return NS_OK; -} - -NS_IMETHODIMP -nsPlatformCharset::GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& aResult) -{ - aResult = mCharset; - return NS_OK; -} - -NS_IMETHODIMP -nsPlatformCharset::Init() -{ - return NS_OK; -} -nsresult -nsPlatformCharset::MapToCharset(short script, short region, nsACString& aCharset) -{ - return NS_OK; -} - -nsresult -nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& aCharset) -{ - return NS_OK; -} - -nsresult -nsPlatformCharset::InitGetCharset(nsACString &aString) -{ - aString = mCharset; - return NS_OK; -} - -nsresult -nsPlatformCharset::ConvertLocaleToCharsetUsingDeprecatedConfig(nsAString& locale, nsACString& aResult) -{ - aResult = mCharset; - return NS_OK; -} - -nsresult -nsPlatformCharset::VerifyCharset(nsCString &aCharset) -{ - aCharset = mCharset; - return NS_OK; -} - -nsresult -nsPlatformCharset::InitInfo() -{ - return NS_OK; -} diff --git a/js/src/Makefile.in b/js/src/Makefile.in index b4eec90db5fa..23d772b8bda3 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -650,8 +650,8 @@ EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib endif -# BeOS and HP-UX do not require the extra linking of "-lm" -ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS OS2,$(OS_ARCH))) +# HP-UX does not require the extra linking of "-lm" +ifeq (,$(filter HP-UX WINNT WINCE OpenVMS OS2,$(OS_ARCH))) EXTRA_LIBS += -lm endif diff --git a/js/src/config/config.mk b/js/src/config/config.mk index 037543f3d003..9fb57b95a533 100644 --- a/js/src/config/config.mk +++ b/js/src/config/config.mk @@ -130,9 +130,6 @@ else LD := $(CC) endif endif -ifeq ($(OS_ARCH),BeOS) -BEOS_ADDON_WORKAROUND = 1 -endif # # Strip off the excessively long version numbers on these platforms, diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index e28cabca2f72..afe5ca33e4d2 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -914,9 +914,6 @@ ifndef NO_COMPONENTS_MANIFEST @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest "manifest components/components.manifest" @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.manifest "binary-component $(SHARED_LIBRARY)" endif -ifdef BEOS_ADDON_WORKAROUND - ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) -endif else # ! IS_COMPONENT ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) $(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib @@ -924,9 +921,6 @@ else $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib endif $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) -ifdef BEOS_ADDON_WORKAROUND - ( cd $(FINAL_TARGET) && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) -endif endif # IS_COMPONENT endif # SHARED_LIBRARY ifdef PROGRAM @@ -1060,12 +1054,6 @@ endif ifdef MOZ_POST_PROGRAM_COMMAND $(MOZ_POST_PROGRAM_COMMAND) $@ endif -ifeq ($(OS_ARCH),BeOS) -ifdef BEOS_PROGRAM_RESOURCE - xres -o $@ $(BEOS_PROGRAM_RESOURCE) - mimeset $@ -endif -endif # BeOS $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) ifeq (WINCE,$(OS_ARCH)) diff --git a/js/src/configure.in b/js/src/configure.in index a752de615063..882d07a3fc82 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1822,12 +1822,6 @@ dnl ======================================================== dnl System overrides of the defaults for host dnl ======================================================== case "$host" in -*-beos*) - HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11" - HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"' - HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" - ;; - *mingw*|*wince|*winmo) # we need Python 2.5 on Windows PYTHON_VERSION=2.5 @@ -1961,24 +1955,6 @@ case "$target" in AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) ;; -*-beos*) - no_x=yes - MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@' - _PLATFORM_DEFAULT_TOOLKIT="cairo-beos" - DSO_LDOPTS='-nostart' - TK_LIBS='-lbe -lroot' - LIBS="$LIBS -lbe" - if test "$COMPILE_ENVIRONMENT"; then - AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind") - AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta") - fi - _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar" - _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar" - _MOZ_USE_RTTI=1 - USE_DEPENDENT_LIBS= - MOZ_USER_DIR="Mozilla" - ;; - *-bsdi*) dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2) _PEDANTIC= @@ -3458,16 +3434,14 @@ case $target in esac dnl We don't want to link with libdl even if it's present on OS X, since -dnl it's not used and not part of the default installation. -dnl The same goes for BeOS. OS/2 has dlfcn in libc. +dnl it's not used and not part of the default installation. OS/2 has dlfcn +dnl in libc. dnl We don't want to link against libm or libpthread on Darwin since dnl they both are just symlinks to libSystem and explicitly linking dnl against libSystem causes issues when debugging (see bug 299601). case $target in *-darwin*) ;; -*-beos*) - ;; *-os2*) ;; *) @@ -5860,9 +5834,7 @@ fi # COMPILE_ENVIRONMENT dnl Set various defines and substitutions dnl ======================================================== -if test "$OS_ARCH" = "BeOS"; then - AC_DEFINE(XP_BEOS) -elif test "$OS_ARCH" = "Darwin"; then +if test "$OS_ARCH" = "Darwin"; then AC_DEFINE(XP_MACOSX) AC_DEFINE(XP_UNIX) AC_DEFINE(UNIX_ASYNC_DNS) diff --git a/js/src/jscpucfg.h b/js/src/jscpucfg.h index c52a44bfc802..24ffd0e19450 100644 --- a/js/src/jscpucfg.h +++ b/js/src/jscpucfg.h @@ -72,7 +72,7 @@ #endif /* _WIN32 || XP_OS2 || WINCE*/ -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) #error "This file is supposed to be auto-generated on UNIX platforms, but the" #error "static version for Mac and Windows platforms is being used." @@ -80,7 +80,7 @@ #else -#error "Must define one of XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX" +#error "Must define one of XP_OS2, XP_WIN, or XP_UNIX" #endif diff --git a/js/src/jsgcchunk.cpp b/js/src/jsgcchunk.cpp index 08ca549f0ff4..db9786105880 100644 --- a/js/src/jsgcchunk.cpp +++ b/js/src/jsgcchunk.cpp @@ -56,7 +56,7 @@ # include # include -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) # include # include @@ -288,7 +288,7 @@ UnmapPages(void *addr, size_t size) == KERN_SUCCESS); } -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) /* Required on Solaris 10. Might improve performance elsewhere. */ # if defined(SOLARIS) && defined(MAP_ALIGN) diff --git a/js/src/jsotypes.h b/js/src/jsotypes.h index bfc85ccc2367..89d1b2135c02 100644 --- a/js/src/jsotypes.h +++ b/js/src/jsotypes.h @@ -51,21 +51,6 @@ #ifndef PROTYPES_H #define PROTYPES_H -#ifdef XP_BEOS -/* BeOS defines most int types in SupportDefs.h (int8, uint8, int16, - * uint16, int32, uint32, int64, uint64), so in the interest of - * not conflicting with other definitions elsewhere we have to skip the - * #ifdef jungle below, duplicate some definitions, and do our stuff. - */ -#include - -typedef JSUintn uintn; -#ifndef _XP_Core_ -typedef JSIntn intn; -#endif - -#else - /* SVR4 typedef of uint is commonly found on UNIX machines. */ #ifdef XP_UNIX #include @@ -108,8 +93,6 @@ typedef JSInt16 int16; typedef JSInt8 int8; #endif /* AIX && HAVE_SYS_INTTYPES_H */ -#endif /* XP_BEOS */ - typedef JSFloat64 float64; /* Re: jsbit.h */ diff --git a/js/src/prmjtime.cpp b/js/src/prmjtime.cpp index d0114e8bf94c..3518b753286d 100644 --- a/js/src/prmjtime.cpp +++ b/js/src/prmjtime.cpp @@ -79,7 +79,7 @@ #endif -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX #ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris */ extern int gettimeofday(struct timeval *tv); @@ -326,7 +326,7 @@ PRMJ_Now(void) return s; } -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) JSInt64 PRMJ_Now(void) { @@ -575,7 +575,7 @@ size_t PRMJ_FormatTime(char *buf, int buflen, const char *fmt, PRMJTime *prtm) { size_t result = 0; -#if defined(XP_UNIX) || defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS) +#if defined(XP_UNIX) || defined(XP_WIN) || defined(XP_OS2) struct tm a; int fake_tm_year = 0; #ifdef NS_HAVE_INVALID_PARAMETER_HANDLER diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index eeb0f892fff1..8eaaa10d527f 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -5259,7 +5259,7 @@ static JSBool env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) { /* XXX porting may be easy, but these don't seem to supply setenv by default */ -#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS +#if !defined XP_OS2 && !defined SOLARIS int rv; IdToString idstr(cx, id, JS_TRUE); @@ -5295,7 +5295,7 @@ env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) return JS_FALSE; } *vp = valstr.getJSVal(); -#endif /* !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS */ +#endif /* !defined XP_OS2 && !defined SOLARIS */ return JS_TRUE; } diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp index 7296fc19ba6d..d7710a0f65d6 100644 --- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp @@ -102,7 +102,7 @@ static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect static const char kObserverServiceContractID[] = "@mozilla.org/observer-service;1"; /* Some platforms don't have an implementation of PR_MemMap(). */ -#if !defined(XP_BEOS) && !defined(XP_OS2) +#ifndef XP_OS2 #define HAVE_PR_MEMMAP #endif diff --git a/js/src/xpconnect/shell/xpcshell.cpp b/js/src/xpconnect/shell/xpcshell.cpp index 7b85c81c0687..1d74ae5977c4 100644 --- a/js/src/xpconnect/shell/xpcshell.cpp +++ b/js/src/xpconnect/shell/xpcshell.cpp @@ -892,7 +892,7 @@ static JSBool env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) { /* XXX porting may be easy, but these don't seem to supply setenv by default */ -#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS +#if !defined XP_OS2 && !defined SOLARIS JSString *idstr, *valstr; int rv; @@ -938,7 +938,7 @@ env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) return JS_FALSE; } *vp = STRING_TO_JSVAL(valstr); -#endif /* !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS */ +#endif /* !defined XP_OS2 && !defined SOLARIS */ return JS_TRUE; } diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 875222413d5c..e1d7c1f8ce57 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1071,12 +1071,10 @@ nsPresContext::UpdateCharSet(const nsAFlatCString& aCharSet) // this will be a language group (or script) code rather than a true language code // bug 39570: moved from nsLanguageAtomService::LookupCharSet() -#if !defined(XP_BEOS) if (mLanguage == nsGkAtoms::Unicode) { NS_RELEASE(mLanguage); NS_IF_ADDREF(mLanguage = mLangService->GetLocaleLanguage()); } -#endif GetFontPreferences(); } #ifdef IBMBIDI diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index b8e59d9358ae..2d3b22be3275 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -83,8 +83,6 @@ nsRecyclingAllocator *gZlibAllocator = NULL; #include #elif defined(XP_WIN) || defined(XP_OS2) #include -#elif defined(XP_BEOS) - #include #endif #ifdef __SYMBIAN32__ @@ -115,7 +113,7 @@ static const PRUint16 kSyntheticDate = (1 + (1 << 5) + (0 << 9)); static PRUint16 xtoint(const PRUint8 *ii); static PRUint32 xtolong(const PRUint8 *ll); static PRUint32 HashName(const char* aName, PRUint16 nameLen); -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX static nsresult ResolveSymlink(const char *path); #endif @@ -440,7 +438,7 @@ nsresult nsZipArchive::ExtractFile(nsZipItem *item, const char *outname, PR_Close(aFd); if (rv != NS_OK) PR_Delete(outname); -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX else if (item->IsSymlink()) rv = ResolveSymlink(outname); #endif @@ -550,7 +548,7 @@ MOZ_WIN_MEM_TRY_CATCH(return NS_ERROR_FAILURE) return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST; } -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX //--------------------------------------------- // ResolveSymlink //--------------------------------------------- @@ -987,7 +985,7 @@ PRTime nsZipItem::LastModTime() return GetModTime(Date(), Time()); } -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX bool nsZipItem::IsSymlink() { if (isSynthetic) return false; diff --git a/modules/libjar/nsZipArchive.h b/modules/libjar/nsZipArchive.h index c1b5730487e5..47f61c6e03ce 100644 --- a/modules/libjar/nsZipArchive.h +++ b/modules/libjar/nsZipArchive.h @@ -112,7 +112,7 @@ public: const PRUint8* GetExtraField(PRUint16 aTag, PRUint16 *aBlockSize); PRTime LastModTime(); -#if defined(XP_UNIX) || defined(XP_BEOS) +#ifdef XP_UNIX bool IsSymlink(); #endif diff --git a/modules/libpr0n/decoders/Makefile.in b/modules/libpr0n/decoders/Makefile.in index 964c0882daaf..0b5f51fc52fc 100644 --- a/modules/libpr0n/decoders/Makefile.in +++ b/modules/libpr0n/decoders/Makefile.in @@ -79,9 +79,6 @@ endif ifeq ($(OS_ARCH),OS2) DIRS = icon/os2 icon endif -ifeq ($(OS_ARCH),BeOS) -DIRS = icon/beos icon -endif ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) DIRS = icon/mac icon endif diff --git a/modules/libpr0n/decoders/icon/Makefile.in b/modules/libpr0n/decoders/icon/Makefile.in index b1b3d97849ee..4dab3e5a346f 100644 --- a/modules/libpr0n/decoders/icon/Makefile.in +++ b/modules/libpr0n/decoders/icon/Makefile.in @@ -72,11 +72,6 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) PLATFORM = mac endif -ifeq ($(OS_ARCH),BeOS) -PLATFORM = beos -endif - - CPPSRCS = \ nsIconURI.cpp \ nsIconModule.cpp \ diff --git a/modules/libpr0n/decoders/icon/beos/Makefile.in b/modules/libpr0n/decoders/icon/beos/Makefile.in deleted file mode 100644 index a32f6187479d..000000000000 --- a/modules/libpr0n/decoders/icon/beos/Makefile.in +++ /dev/null @@ -1,56 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Makefile for the Gnome icon decoder. -# -# The Initial Developer of the Original Code is -# Christian Biesinger . -# Portions created by the Initial Developer are Copyright (C) 2004 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = imgicon -LIBRARY_NAME = imgiconbeos_s -LIBXUL_LIBRARY = 1 - - -CPPSRCS = nsIconChannel.cpp - -# we don't want the shared lib, but we want to force the creation of a static lib. -FORCE_STATIC_LIB = 1 - -include $(topsrcdir)/config/rules.mk - diff --git a/modules/libpr0n/decoders/icon/beos/nsIconChannel.cpp b/modules/libpr0n/decoders/icon/beos/nsIconChannel.cpp deleted file mode 100644 index 9e70ea50396a..000000000000 --- a/modules/libpr0n/decoders/icon/beos/nsIconChannel.cpp +++ /dev/null @@ -1,486 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Brian Ryner. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Scott MacGregor - * Neil Rashbrook - * Ben Goodger - * Simon Taylor - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#include "nsIconChannel.h" -#include "nsIIconURI.h" -#include "nsIServiceManager.h" -#include "nsIInterfaceRequestor.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsXPIDLString.h" -#include "nsReadableUtils.h" -#include "nsMimeTypes.h" -#include "nsMemory.h" -#include "nsIStringStream.h" -#include "nsIURL.h" -#include "nsNetUtil.h" -#include "nsInt64.h" -#include "nsIFile.h" -#include "nsIFileURL.h" -#include "nsIMIMEService.h" -#include "nsDirectoryServiceDefs.h" - -#include -#include -#include -#include -#include - -// nsIconChannel methods -nsIconChannel::nsIconChannel() -{ -} - -nsIconChannel::~nsIconChannel() -{} - -NS_IMPL_THREADSAFE_ISUPPORTS4(nsIconChannel, - nsIChannel, - nsIRequest, - nsIRequestObserver, - nsIStreamListener) - -nsresult nsIconChannel::Init(nsIURI* uri) -{ - NS_ASSERTION(uri, "no uri"); - mUrl = uri; - mOriginalURI = uri; - nsresult rv; - mPump = do_CreateInstance(NS_INPUTSTREAMPUMP_CONTRACTID, &rv); - return rv; -} - -//////////////////////////////////////////////////////////////////////////////// -// nsIRequest methods: - -NS_IMETHODIMP nsIconChannel::GetName(nsACString &result) -{ - return mUrl->GetSpec(result); -} - -NS_IMETHODIMP nsIconChannel::IsPending(PRBool *result) -{ - return mPump->IsPending(result); -} - -NS_IMETHODIMP nsIconChannel::GetStatus(nsresult *status) -{ - return mPump->GetStatus(status); -} - -NS_IMETHODIMP nsIconChannel::Cancel(nsresult status) -{ - return mPump->Cancel(status); -} - -NS_IMETHODIMP nsIconChannel::Suspend(void) -{ - return mPump->Suspend(); -} - -NS_IMETHODIMP nsIconChannel::Resume(void) -{ - return mPump->Resume(); -} -NS_IMETHODIMP nsIconChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_IF_ADDREF(*aLoadGroup); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) -{ - mLoadGroup = aLoadGroup; - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::GetLoadFlags(PRUint32 *aLoadAttributes) -{ - return mPump->GetLoadFlags(aLoadAttributes); -} - -NS_IMETHODIMP nsIconChannel::SetLoadFlags(PRUint32 aLoadAttributes) -{ - return mPump->SetLoadFlags(aLoadAttributes); -} - -//////////////////////////////////////////////////////////////////////////////// -// nsIChannel methods: - -NS_IMETHODIMP nsIconChannel::GetOriginalURI(nsIURI* *aURI) -{ - *aURI = mOriginalURI; - NS_ADDREF(*aURI); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::SetOriginalURI(nsIURI* aURI) -{ - NS_ENSURE_ARG_POINTER(aURI); - mOriginalURI = aURI; - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::GetURI(nsIURI* *aURI) -{ - *aURI = mUrl; - NS_IF_ADDREF(*aURI); - return NS_OK; -} - -NS_IMETHODIMP -nsIconChannel::Open(nsIInputStream **_retval) -{ - return MakeInputStream(_retval, PR_FALSE); -} - -nsresult nsIconChannel::ExtractIconInfoFromUrl(nsIFile ** aLocalFile, PRUint32 * aDesiredImageSize, nsACString &aContentType, nsACString &aFileExtension) -{ - nsresult rv = NS_OK; - nsCOMPtr iconURI (do_QueryInterface(mUrl, &rv)); - NS_ENSURE_SUCCESS(rv, rv); - - iconURI->GetImageSize(aDesiredImageSize); - iconURI->GetContentType(aContentType); - iconURI->GetFileExtension(aFileExtension); - - nsCOMPtr fileURI; - rv = iconURI->GetIconFile(getter_AddRefs(fileURI)); - if (NS_FAILED(rv) || !fileURI) return NS_OK; - - nsCOMPtr fileURL = do_QueryInterface(fileURI, &rv); - if (NS_FAILED(rv) || !fileURL) return NS_OK; - - nsCOMPtr file; - rv = fileURL->GetFile(getter_AddRefs(file)); - if (NS_FAILED(rv) || !file) return NS_OK; - - *aLocalFile = file; - NS_IF_ADDREF(*aLocalFile); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *ctxt) -{ - nsCOMPtr inStream; - nsresult rv = MakeInputStream(getter_AddRefs(inStream), PR_TRUE); - if (NS_FAILED(rv)) - return rv; - - // Init our streampump - rv = mPump->Init(inStream, nsInt64(-1), nsInt64(-1), 0, 0, PR_FALSE); - if (NS_FAILED(rv)) - return rv; - - rv = mPump->AsyncRead(this, ctxt); - if (NS_SUCCEEDED(rv)) { - // Store our real listener - mListener = aListener; - // Add ourself to the load group, if available - if (mLoadGroup) - mLoadGroup->AddRequest(this, nsnull); - } - return rv; -} - -nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBlocking) -{ - nsXPIDLCString contentType; - nsCAutoString filePath; - nsCAutoString fileExtension; - nsCOMPtr localFile; // File we want an icon for - PRUint32 desiredImageSize; - nsresult rv = ExtractIconInfoFromUrl(getter_AddRefs(localFile), &desiredImageSize, contentType, fileExtension); - NS_ENSURE_SUCCESS(rv, rv); - - PRUint32 iconSize = 16; - if (desiredImageSize > 16) - iconSize = 32; - - PRUint32 alphaBytesPerRow = (iconSize / 8); - if (iconSize % 32 != 0) - alphaBytesPerRow = ((iconSize / 32) + 1) * 4; - - PRBool fileExists = PR_FALSE; - if (localFile) - { - localFile->GetNativePath(filePath); - localFile->Exists(&fileExists); - } - - // Get the native icon. - // 1) If it is for an actual local file, BNodeInfo::GetTrackerIcon. - // 2) If the local file does not exist, use the content type - // and BMimeType::GetIcon - BBitmap nativeIcon(BRect(0, 0, iconSize - 1, iconSize - 1), B_CMAP8); - if (!nativeIcon.IsValid()) - return NS_ERROR_OUT_OF_MEMORY; - - PRBool gotBitmap = PR_FALSE; - if (fileExists) - { - BNode localNode(filePath.get()); - // BeOS doesn't MIME type foreign files immediately - - // If there is no type attribute then we can force an identify - if (localNode.ReadAttr("BEOS:TYPE", B_STRING_TYPE, 0, NULL, 0) != B_OK) - update_mime_info(filePath.get(), 0, 1, 1); - - BNodeInfo localNodeInfo(&localNode); - if (iconSize == 16) - { - if (localNodeInfo.GetTrackerIcon(&nativeIcon, B_MINI_ICON) == B_OK) - gotBitmap = PR_TRUE; - } - else - { - if (localNodeInfo.GetTrackerIcon(&nativeIcon, B_LARGE_ICON) == B_OK) - gotBitmap = PR_TRUE; - } - } - - // If we haven't got a bitmap yet, use the content type - if (!gotBitmap) - { - // If no content type specified, use mozilla's mime service to guess a mime type - if (contentType.IsEmpty()) - { - nsCOMPtr mimeService (do_GetService("@mozilla.org/mime;1", &rv)); - if (NS_SUCCEEDED(rv)) - mimeService->GetTypeFromExtension(fileExtension, contentType); - // If unrecognised extension - set to generic file - if (contentType.IsEmpty()) - contentType = "application/octet-stream"; - } - // Create BeOS-Native MIME type info - if unheard of, set to generic file - BMimeType mimeType(contentType.get()); - if (!mimeType.IsInstalled()) - mimeType.SetTo("application/octet-stream"); - if (iconSize == 16) - { - if (mimeType.GetIcon(&nativeIcon, B_MINI_ICON) == B_OK) - gotBitmap = PR_TRUE; - } - else - { - if (mimeType.GetIcon(&nativeIcon, B_LARGE_ICON) == B_OK) - gotBitmap = PR_TRUE; - } - } - - if (!gotBitmap) - return NS_ERROR_NOT_AVAILABLE; - - BScreen mainScreen(B_MAIN_SCREEN_ID); - if (!mainScreen.IsValid()) - return NS_ERROR_NOT_AVAILABLE; - - // Got a bitmap and color space info - convert data to mozilla's icon format - PRUint32 iconLength = 2 + iconSize * iconSize * 4; - uint8 *buffer = new uint8[iconLength]; - if (!buffer) - return NS_ERROR_OUT_OF_MEMORY; - - uint8* destByte = buffer; - *(destByte++) = iconSize; - *(destByte++) = iconSize; - - // RGB data - uint8* sourceByte = (uint8*)nativeIcon.Bits(); - for(PRUint32 iconRow = 0; iconRow < iconSize; iconRow++) - { - sourceByte = (uint8*)nativeIcon.Bits() + nativeIcon.BytesPerRow() * iconRow; - for(PRUint32 iconCol = 0; iconCol < iconSize; iconCol++) - { - if (*sourceByte != B_TRANSPARENT_MAGIC_CMAP8) - { - rgb_color colorVal = mainScreen.ColorForIndex(*sourceByte); -#ifdef IS_LITTLE_ENDIAN - *(destByte++) = colorVal.blue; - *(destByte++) = colorVal.green; - *(destByte++) = colorVal.red; - *(destByte++) = uint8(255); -#else - *(destByte++) = uint8(255); - *(destByte++) = colorVal.red; - *(destByte++) = colorVal.green; - *(destByte++) = colorVal.blue; -#endif - } - else - { - *destByte++ = 0; - *destByte++ = 0; - *destByte++ = 0; - *destByte++ = 0; - } - // original code had a conditional here: - // if (iconCol < iconSize - 1) - // Leaving this comment in case complications arise later - sourceByte++; - } - } - - NS_ASSERTION(buffer + iconLength == destByte, "size miscalculation"); - - // Now, create a pipe and stuff our data into it - nsCOMPtr inStream; - nsCOMPtr outStream; - rv = NS_NewPipe(getter_AddRefs(inStream), getter_AddRefs(outStream), - iconLength, iconLength, nonBlocking); - if (NS_SUCCEEDED(rv)) - { - PRUint32 written; - rv = outStream->Write((char*)buffer, iconLength, &written); - if (NS_SUCCEEDED(rv)) - NS_ADDREF(*_retval = inStream); - } - delete [] buffer; - - return rv; -} - -NS_IMETHODIMP nsIconChannel::GetContentType(nsACString &aContentType) -{ - aContentType.AssignLiteral("image/icon"); - return NS_OK; -} - -NS_IMETHODIMP -nsIconChannel::SetContentType(const nsACString &aContentType) -{ - // It doesn't make sense to set the content-type on this type - // of channel... - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP nsIconChannel::GetContentCharset(nsACString &aContentCharset) -{ - aContentCharset.Truncate(); - return NS_OK; -} - -NS_IMETHODIMP -nsIconChannel::SetContentCharset(const nsACString &aContentCharset) -{ - // It doesn't make sense to set the content-charset on this type - // of channel... - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP nsIconChannel::GetContentLength(PRInt32 *aContentLength) -{ - *aContentLength = mContentLength; - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::SetContentLength(PRInt32 aContentLength) -{ - NS_NOTREACHED("nsIconChannel::SetContentLength"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP nsIconChannel::GetOwner(nsISupports* *aOwner) -{ - *aOwner = mOwner.get(); - NS_IF_ADDREF(*aOwner); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::SetOwner(nsISupports* aOwner) -{ - mOwner = aOwner; - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::GetNotificationCallbacks(nsIInterfaceRequestor* *aNotificationCallbacks) -{ - *aNotificationCallbacks = mCallbacks.get(); - NS_IF_ADDREF(*aNotificationCallbacks); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks) -{ - mCallbacks = aNotificationCallbacks; - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) -{ - *aSecurityInfo = nsnull; - return NS_OK; -} - -// nsIRequestObserver methods -NS_IMETHODIMP nsIconChannel::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) -{ - if (mListener) - return mListener->OnStartRequest(this, aContext); - return NS_OK; -} - -NS_IMETHODIMP nsIconChannel::OnStopRequest(nsIRequest* aRequest, nsISupports* aContext, nsresult aStatus) -{ - if (mListener) { - mListener->OnStopRequest(this, aContext, aStatus); - mListener = nsnull; - } - - // Remove from load group - if (mLoadGroup) - mLoadGroup->RemoveRequest(this, nsnull, aStatus); - - return NS_OK; -} - -// nsIStreamListener methods -NS_IMETHODIMP nsIconChannel::OnDataAvailable(nsIRequest* aRequest, - nsISupports* aContext, - nsIInputStream* aStream, - PRUint32 aOffset, - PRUint32 aCount) -{ - if (mListener) - return mListener->OnDataAvailable(this, aContext, aStream, aOffset, aCount); - return NS_OK; -} diff --git a/modules/libpr0n/decoders/icon/beos/nsIconChannel.h b/modules/libpr0n/decoders/icon/beos/nsIconChannel.h deleted file mode 100644 index bf59799ae8b7..000000000000 --- a/modules/libpr0n/decoders/icon/beos/nsIconChannel.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Brian Ryner. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Scott MacGregor - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsIconChannel_h___ -#define nsIconChannel_h___ - -#include "nsCOMPtr.h" -#include "nsXPIDLString.h" -#include "nsIChannel.h" -#include "nsILoadGroup.h" -#include "nsIInterfaceRequestor.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsIURI.h" -#include "nsIInputStreamPump.h" -#include "nsIStreamListener.h" - -class nsIFile; - -class nsIconChannel : public nsIChannel, public nsIStreamListener -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIREQUEST - NS_DECL_NSICHANNEL - NS_DECL_NSIREQUESTOBSERVER - NS_DECL_NSISTREAMLISTENER - - nsIconChannel(); - ~nsIconChannel(); - - nsresult Init(nsIURI* uri); - -protected: - nsCOMPtr mUrl; - nsCOMPtr mOriginalURI; - PRInt32 mContentLength; - nsCOMPtr mLoadGroup; - nsCOMPtr mCallbacks; - nsCOMPtr mOwner; - - nsCOMPtr mPump; - nsCOMPtr mListener; - - nsresult ExtractIconInfoFromUrl(nsIFile ** aLocalFile, PRUint32 * aDesiredImageSize, nsACString &aContentType, nsACString &aFileExtension); - nsresult MakeInputStream(nsIInputStream** _retval, PRBool nonBlocking); -}; - -#endif /* nsIconChannel_h___ */ diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in index 0713f68f6b84..1bf0fdad3280 100644 --- a/modules/libpref/src/Makefile.in +++ b/modules/libpref/src/Makefile.in @@ -81,7 +81,7 @@ include $(topsrcdir)/config/rules.mk GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, \ mailnews.js editor.js \ - aix.js beos.js unix.js winpref.js os2prefs.js openvms.js) + aix.js unix.js winpref.js os2prefs.js openvms.js) GARBAGE += greprefs.js diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 64d8371686ed..ba383abbd5d1 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -2452,102 +2452,6 @@ pref("mousewheel.system_scroll_override_on_root_content.enabled", false); # OS2 #endif -#ifdef XP_BEOS - -pref("intl.font_charset", ""); -pref("intl.font_spec_list", ""); -pref("mail.signature_date", 0); - -pref("font.alias-list", "sans,sans-serif,serif,monospace"); - -pref("font.default.ar", "sans-serif"); -pref("font.size.variable.ar", 16); -pref("font.size.fixed.ar", 13); - -pref("font.default.el", "serif"); -pref("font.size.variable.el", 16); -pref("font.size.fixed.el", 13); - -pref("font.default.he", "sans-serif"); -pref("font.size.variable.he", 16); -pref("font.size.fixed.he", 13); - -pref("font.default.ja", "sans-serif"); -pref("font.size.variable.ja", 16); -pref("font.size.fixed.ja", 16); - -pref("font.default.ko", "sans-serif"); -pref("font.size.variable.ko", 16); -pref("font.size.fixed.ko", 16); - -pref("font.default.th", "serif"); -pref("font.size.variable.th", 16); -pref("font.size.fixed.th", 13); - -pref("font.default.tr", "serif"); -pref("font.size.variable.tr", 16); -pref("font.size.fixed.tr", 13); - -pref("font.default.x-baltic", "serif"); -pref("font.size.variable.x-baltic", 16); -pref("font.size.fixed.x-baltic", 13); - -pref("font.default.x-central-euro", "serif"); -pref("font.size.variable.x-central-euro", 16); -pref("font.size.fixed.x-central-euro", 13); - -pref("font.default.x-cyrillic", "serif"); -pref("font.size.variable.x-cyrillic", 16); -pref("font.size.fixed.x-cyrillic", 13); - -pref("font.default.x-unicode", "serif"); -pref("font.size.variable.x-unicode", 16); -pref("font.size.fixed.x-unicode", 13); - -pref("font.default.x-western", "serif"); -pref("font.size.variable.x-western", 16); -pref("font.size.fixed.x-western", 13); - -pref("font.default.zh-CN", "sans-serif"); -pref("font.size.variable.zh-CN", 16); -pref("font.size.fixed.zh-CN", 16); - -pref("font.default.zh-TW", "sans-serif"); -pref("font.size.variable.zh-TW", 16); -pref("font.size.fixed.zh-TW", 16); - -pref("font.default.zh-HK", "sans-serif"); -pref("font.size.variable.zh-HK", 16); -pref("font.size.fixed.zh-HK", 16); - -/** - * Set default accelKey to "Alt", which is the default under BeOS. - * The generalAccessKey is used for shortcuts on web pages, set to - * Ctrl+Shift. The menuAccessKey is now the "windows" key. - */ -pref("ui.key.accelKey", 18); -pref("ui.key.menuAccessKey", 17); -pref("ui.key.generalAccessKey", -1); - -// If generalAccessKey is -1, use the following two prefs instead. -// Use 0 for disabled, 1 for Shift, 2 for Ctrl, 4 for Alt, 8 for Meta -// (values can be combined, e.g. 3 for Ctrl+Shift) -pref("ui.key.chromeAccess", 2); -pref("ui.key.contentAccess", 3); - -// xxx toolkit? -pref("browser.download.dir", "/boot/home/Downloads"); - -// IMEs of BeOS might use non-topmost windows for topmost element, -// see bug 451015. If there are other problems by this value, we may need to -// change this value. -pref("ui.panel.default_level_parent", false); - -pref("mousewheel.system_scroll_override_on_root_content.enabled", false); - -# BeOS -#endif - #ifdef ANDROID // Handled differently under Mac/Windows pref("network.protocol-handler.warn-external.file", false); diff --git a/modules/libpref/src/prefapi.cpp b/modules/libpref/src/prefapi.cpp index ec005d734489..6a3e3207ae84 100644 --- a/modules/libpref/src/prefapi.cpp +++ b/modules/libpref/src/prefapi.cpp @@ -72,10 +72,6 @@ #include #endif -#ifdef XP_BEOS -#include "Alert.h" -#endif - #define BOGUS_DEFAULT_INT_PREF_VALUE (-5632) #define BOGUS_DEFAULT_BOOL_PREF_VALUE (-2) diff --git a/modules/plugin/base/src/Makefile.in b/modules/plugin/base/src/Makefile.in index b6e5d089be9c..022cf822b9ef 100644 --- a/modules/plugin/base/src/Makefile.in +++ b/modules/plugin/base/src/Makefile.in @@ -69,10 +69,6 @@ CPPSRCS = \ PluginPRLibrary.cpp \ $(NULL) -ifeq ($(OS_ARCH), BeOS) - CPPSRCS += nsPluginsDirBeOS.cpp - CPPSRCS += nsPluginNativeWindow.cpp -else ifneq (,$(filter WINNT WINCE,$(OS_ARCH))) CPPSRCS += nsPluginsDirWin.cpp CPPSRCS += nsPluginNativeWindowWin.cpp @@ -100,7 +96,6 @@ endif endif endif endif -endif LOCAL_INCLUDES = \ -I$(topsrcdir)/xpcom/base/ \ diff --git a/modules/plugin/base/src/nsPluginsDirBeOS.cpp b/modules/plugin/base/src/nsPluginsDirBeOS.cpp deleted file mode 100644 index e0fdc72a6c51..000000000000 --- a/modules/plugin/base/src/nsPluginsDirBeOS.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alex Musil - * Makoto Hamanaka - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - nsPluginsDirBeOS.cpp - - BeOS implementation of the nsPluginsDir/nsPluginsFile classes. - - Based on nsPluginsDirUNIX.cpp r1.12 by Alex Musil - */ - -#include "nsPluginsDir.h" -#include "prlink.h" -#include "plstr.h" -#include "prmem.h" -#include "nsReadableUtils.h" -#include "nsString.h" - -#include -#include -#include -#include - -//#define NS_PLUGIN_BEOS_DEBUG - -/* Local helper functions */ - -static char* GetFileName(const char* pathname) -{ - const char* filename = nsnull; - - // this is most likely a path, so skip to the filename - filename = PL_strrchr(pathname, '/'); - if(filename) - ++filename; - else - filename = pathname; - - return PL_strdup(filename); -} - -static nsresult GetMimeExtensions(const char *mimeType, char *extensions, int extLen) -{ - // check variables - if (!mimeType || !extensions || extLen < 1) return NS_ERROR_FAILURE; - extensions[0] = '\0'; - - // make mime object - BMimeType mime(mimeType) ; - if (mime.InitCheck() != B_OK) - return NS_ERROR_FAILURE; - - // get extensions : comma separated (if multiple extensions in a mime-type) - // ex) "jpg,jpeg" - BString extStr(""); - BMessage extMsg; - mime.GetFileExtensions(&extMsg); - uint32 type; - int32 types_num; - if (extMsg.GetInfo("extensions", &type, &types_num) != B_OK - || type != B_STRING_TYPE || types_num == 0) - return NS_ERROR_FAILURE; - - for (int i = 0 ; i < types_num ; i ++) { - const char *ext; - if (extMsg.FindString("extensions", i, &ext) != B_OK) { - break; - } - if (i > 0) - extStr.Append(","); - extStr.Append(ext); - } - PL_strncpyz(extensions, extStr.String(), extLen) ; - - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////// - -/* nsPluginsDir implementation */ - -PRBool nsPluginsDir::IsPluginFile(nsIFile* file) -{ - return PR_TRUE; -} - -/////////////////////////////////////////////////////////////////////////// - -/* nsPluginFile implementation */ - -nsPluginFile::nsPluginFile(nsIFile* spec) -: mPlugin(spec) -{ - // nada -} - -nsPluginFile::~nsPluginFile() -{ - // nada -} - -/** - * Loads the plugin into memory using NSPR's shared-library loading - * mechanism. Handles platform differences in loading shared libraries. - */ -nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) -{ - nsCAutoString path; - nsresult rv = mPlugin->GetNativePath(path); - if (NS_OK != rv) { - return rv; - } - pLibrary = *outLibrary = PR_LoadLibrary(path.get()); - -#ifdef NS_DEBUG - printf("LoadPlugin() %s returned %lx\n",path,(unsigned long)pLibrary); -#endif - - return NS_OK; -} - -typedef char* (*BeOS_Plugin_GetMIMEDescription)(); - - -/** - * Obtains all of the information currently available for this plugin. - */ -nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) -{ - *outLibrary = nsnull; - - info.fVersion = nsnull; - - nsCAutoString fullPath; - if (NS_FAILED(rv = mPlugin->GetNativePath(fullPath))) - return rv; - - nsCAutoString fileName; - if (NS_FAILED(rv = mPlugin->GetNativeLeafName(fileName))) - return rv; - - const char *path = fullPath.get(); - int i; - -#ifdef NS_PLUGIN_BEOS_DEBUG - printf("nsPluginFile::GetPluginInfo() an attempt to load MIME String\n"); - printf("path = <%s>\n", path); -#endif - - // get supported mime types - BFile file(path, B_READ_ONLY); - if (file.InitCheck() != B_OK) - return NS_ERROR_FAILURE; - - BAppFileInfo appinfo(&file); - if (appinfo.InitCheck() != B_OK) - return NS_ERROR_FAILURE; - - BMessage msg; - if (appinfo.GetSupportedTypes(&msg) != B_OK) - return NS_ERROR_FAILURE; - - uint32 type; - int32 types_num; - if (msg.GetInfo("types", &type, &types_num) != B_OK - || type != B_STRING_TYPE) - return NS_ERROR_FAILURE; - - // set mime types to plugin info - info.fMimeTypeArray =(char **)PR_Malloc(types_num * sizeof(char *)); - info.fMimeDescriptionArray =(char **)PR_Malloc(types_num * sizeof(char *)); - info.fExtensionArray =(char **)PR_Malloc(types_num * sizeof(char *)); - - for (i = 0 ; i < types_num ; i ++) { - // get mime string - const char *mtype; - if (msg.FindString("types", i, &mtype) != B_OK) { - types_num = i; - break; - } - - // get (short)description for the mime - char desc[B_MIME_TYPE_LENGTH+1] = ""; - BMimeType mime(mtype) ; - if (mime.InitCheck() == B_OK) - mime.GetShortDescription(desc); - - // get file extensions for the mime - char extensions[B_MIME_TYPE_LENGTH+1] = ""; - GetMimeExtensions(mtype, extensions, B_MIME_TYPE_LENGTH+1); - - #ifdef NS_PLUGIN_BEOS_DEBUG - printf(" mime = %30s | %10s | %15s |\n", - mtype, extensions, desc); - #endif - - info.fMimeTypeArray[i] = PL_strdup( mtype ? mtype : (char *)"" ) ; - info.fMimeDescriptionArray[i] = PL_strdup( desc ) ; - info.fExtensionArray[i] = PL_strdup( extensions ); - } - - // get name and description of this plugin - version_info vinfo; - if (appinfo.GetVersionInfo(&vinfo, B_APP_VERSION_KIND) == B_OK - && *vinfo.short_info) { - // XXX convert UTF-8 2byte chars to 1 byte chars, to avoid string corruption - info.fName = ToNewCString(NS_ConvertUTF8toUTF16(vinfo.short_info)); - info.fDescription = ToNewCString(NS_ConvertUTF8toUTF16(vinfo.long_info)); - } else { - // use filename as its name - info.fName = GetFileName(path); - info.fDescription = PL_strdup(""); - } - - info.fVariantCount = types_num; - info.fFullPath = PL_strdup(fullPath.get()); - info.fFileName = PL_strdup(fileName.get()); - -#ifdef NS_PLUGIN_BEOS_DEBUG - printf("info.fFileName = %s\n", info.fFileName); - printf("info.fName = %s\n", info.fName); - printf("info.fDescription = %s\n", info.fDescription); -#endif - - return NS_OK; -} - -nsresult nsPluginFile::FreePluginInfo(nsPluginInfo& info) -{ - if (info.fName) - PL_strfree(info.fName); - - if (info.fDescription) - PL_strfree(info.fDescription); - - for (PRUint32 i = 0; i < info.fVariantCount; i++) { - if (info.fMimeTypeArray[i]) - PL_strfree(info.fMimeTypeArray[i]); - - if (info.fMimeDescriptionArray[i]) - PL_strfree(info.fMimeDescriptionArray[i]); - - if (info.fExtensionArray[i]) - PL_strfree(info.fExtensionArray[i]); - } - - PR_FREEIF(info.fMimeTypeArray); - PR_FREEIF(info.fMimeDescriptionArray); - PR_FREEIF(info.fExtensionArray); - - if (info.fFullPath) - PL_strfree(info.fFullPath); - - if (info.fFileName) - PL_strfree(info.fFileName); - - if (info.fVersion) - PL_strfree(info.fVersion); - - return NS_OK; -} diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index e077812200cf..715020ba6f64 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -42,7 +42,7 @@ #include // include files for ftruncate (or equivalent) -#if defined(XP_UNIX) || defined(XP_BEOS) +#if defined(XP_UNIX) #include #elif defined(XP_WIN) #include @@ -316,7 +316,7 @@ nsDiskCache::Truncate(PRFileDesc * fd, PRUint32 newEOF) { // use modified SetEOF from nsFileStreams::SetEOF() -#if defined(XP_UNIX) || defined(XP_BEOS) +#if defined(XP_UNIX) if (ftruncate(PR_FileDesc2NativeHandle(fd), newEOF) != 0) { NS_ERROR("ftruncate failed"); return NS_ERROR_FAILURE; diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 6728418ef139..fe91f80ca012 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -84,7 +84,7 @@ #include "mozilla/net/NeckoChild.h" #endif -#if defined(XP_UNIX) || defined(XP_BEOS) +#if defined(XP_UNIX) #include #endif @@ -685,8 +685,6 @@ nsHttpHandler::InitUserAgentComponents() "Windows" #elif defined(XP_MACOSX) "Macintosh" -#elif defined(XP_BEOS) - "BeOS" #elif defined(MOZ_PLATFORM_MAEMO) "Maemo" #elif defined(MOZ_X11) @@ -751,7 +749,7 @@ nsHttpHandler::InitUserAgentComponents() (::Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) { mOscpu += nsPrintfCString(" %d.%d", majorVersion, minorVersion); } -#elif defined (XP_UNIX) || defined (XP_BEOS) +#elif defined (XP_UNIX) struct utsname name; int ret = uname(&name); diff --git a/rdf/datasource/src/nsFileSystemDataSource.cpp b/rdf/datasource/src/nsFileSystemDataSource.cpp index 52d9d0aced2d..2818684a1809 100644 --- a/rdf/datasource/src/nsFileSystemDataSource.cpp +++ b/rdf/datasource/src/nsFileSystemDataSource.cpp @@ -69,18 +69,10 @@ #include "nsCRTGlue.h" #include "nsAutoPtr.h" -#ifdef XP_WIN +#ifdef XP_WIN #include "windef.h" #include "winbase.h" #include "nsILineInputStream.h" -#endif - -#ifdef XP_BEOS -#include -#include -#endif - -#if defined(XP_WIN) || defined(XP_BEOS) #include "nsDirectoryServiceDefs.h" #endif @@ -215,22 +207,6 @@ FileSystemDataSource::Init() } #endif -#ifdef XP_BEOS - nsCOMPtr file; - NS_GetSpecialDirectory(NS_BEOS_SETTINGS_DIR, getter_AddRefs(file)); - if (file) - { - file->AppendNative(NS_LITERAL_CSTRING("NetPositive")); - file->AppendNative(NS_LITERAL_CSTRING("Bookmarks")); - - nsCOMPtr furi; - NS_NewFileURI(getter_AddRefs(furi), file); - NS_ENSURE_TRUE(furi, NS_ERROR_FAILURE); - - file->GetNativePath(netPositiveDir); - } -#endif - return NS_OK; } @@ -925,7 +901,7 @@ FileSystemDataSource::GetVolumeList(nsISimpleEnumerator** aResult) } #endif -#if defined(XP_UNIX) || defined(XP_BEOS) || defined(WINCE) +#if defined(XP_UNIX) || defined(WINCE) mRDFService->GetResource(NS_LITERAL_CSTRING("file:///"), getter_AddRefs(vol)); volumes->AppendElement(vol); #endif @@ -1320,48 +1296,6 @@ FileSystemDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral **aResult) } #endif -#ifdef XP_BEOS - // under BEOS, try and get the "META:title" attribute (if its a file) - if (strstr(uri, netPositiveDir.get()) != 0) - { - PRBool value; - if ((NS_SUCCEEDED(aFileLocal->IsFile(&value) && value)) || - (NS_SUCCEEDED(aFileLocal->IsDirectory(&value) && value))) - { - nsXPIDLCString nativePath; - aFileLocal->GetNativePath(nativePath); - - rv = NS_ERROR_FAILURE; - if (nativePath) - { - BFile bf(nativePath.get(), B_READ_ONLY); - if (bf.InitCheck() == B_OK) - { - char beNameAttr[4096]; - ssize_t len; - - if ((len = bf.ReadAttr("META:title", B_STRING_TYPE, - 0, beNameAttr, sizeof(beNameAttr)-1)) > 0) - { - beNameAttr[len] = '\0'; - CopyUTF8toUTF16(beNameAttr, name); - rv = NS_OK; - } - } - } - if (NS_OK != rv) - { - nsCAutoString leafName; - rv = aFileLocal->GetNativeLeafName(leafName); - if (NS_SUCCEEDED(rv)) { - CopyUTF8toUTF16(leafName, name); - rv = NS_OK; - } - } - } - } -#endif - mRDFService->GetLiteral(name.get(), aResult); return NS_OK; @@ -1493,19 +1427,6 @@ FileSystemDataSource::GetURL(nsIRDFResource *source, PRBool *isFavorite, nsIRDFL } #endif -#ifdef XP_BEOS - // under BEOS, try and get the "META:url" attribute - if (!netPositiveDir.IsEmpty()) - { - if (strstr(uri.get(), netPositiveDir.get()) != 0) - { - if (isFavorite) *isFavorite = PR_TRUE; - rv = getNetPositiveURL(source, url, aResult); - return(rv); - } - } -#endif - // if we fall through to here, its not any type of bookmark // stored in the platform native file system, so just set the URL @@ -1513,51 +1434,3 @@ FileSystemDataSource::GetURL(nsIRDFResource *source, PRBool *isFavorite, nsIRDFL return(NS_OK); } - - - -#ifdef XP_BEOS - -nsresult -FileSystemDataSource::getNetPositiveURL(nsIRDFResource *source, nsString aFileURL, nsIRDFLiteral **urlLiteral) -{ - nsresult rv = NS_RDF_NO_VALUE; - - *urlLiteral = nsnull; - - - nsCOMPtr f; - NS_GetFileFromURLSpec(NS_ConvertUTF16toUTF8(aFileURL), getter_AddRefs(f)); - - - - nsXPIDLCString nativePath; - f->GetNativePath(nativePath); - - PRBool value; - if (NS_SUCCEEDED(f->IsFile(&value) && value)) - { - if (nativePath) - { - BFile bf(nativePath.get(), B_READ_ONLY); - if (bf.InitCheck() == B_OK) - { - char beURLattr[4096]; - ssize_t len; - - if ((len = bf.ReadAttr("META:url", B_STRING_TYPE, - 0, beURLattr, sizeof(beURLattr)-1)) > 0) - { - beURLattr[len] = '\0'; - nsAutoString bookmarkURL; - CopyUTF8toUTF16(beURLattr, bookmarkURL); - rv = mRDFService->GetLiteral(bookmarkURL.get(), - urlLiteral); - } - } - } - } - return(rv); -} - -#endif diff --git a/rdf/datasource/src/nsFileSystemDataSource.h b/rdf/datasource/src/nsFileSystemDataSource.h index d9c8861fb3bb..f6410a2aafbb 100644 --- a/rdf/datasource/src/nsFileSystemDataSource.h +++ b/rdf/datasource/src/nsFileSystemDataSource.h @@ -48,7 +48,7 @@ #include "nsString.h" #include "nsCycleCollectionParticipant.h" -#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_WIN) || defined(XP_BEOS) +#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_WIN) #define USE_NC_EXTENSION #endif @@ -109,11 +109,6 @@ private: nsCOMPtr mNC_IEFavoriteFolder; nsCString ieFavoritesDir; #endif - -#ifdef XP_BEOS - nsresult getNetPositiveURL(nsIRDFResource *source, nsString aFileURL, nsIRDFLiteral **urlLiteral); - nsCString netPositiveDir; -#endif }; #endif // nsFileSystemDataSource_h__ diff --git a/toolkit/components/commandlines/src/nsCommandLine.cpp b/toolkit/components/commandlines/src/nsCommandLine.cpp index 79de9e6c3c34..39ae731d2462 100644 --- a/toolkit/components/commandlines/src/nsCommandLine.cpp +++ b/toolkit/components/commandlines/src/nsCommandLine.cpp @@ -64,9 +64,6 @@ #elif defined(XP_WIN) #include #include -#elif defined(XP_BEOS) -#include -#include #elif defined(XP_UNIX) #include #elif defined(XP_OS2) @@ -315,38 +312,6 @@ nsCommandLine::ResolveFile(const nsAString& aArgument, nsIFile* *aResult) NS_ADDREF(*aResult = newfile); return NS_OK; -#elif defined(XP_BEOS) - nsCOMPtr lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); - NS_ENSURE_TRUE(lf, NS_ERROR_OUT_OF_MEMORY); - - if (aArgument.First() == '/') { - // absolute path - rv = lf->InitWithPath(aArgument); - if (NS_FAILED(rv)) return rv; - - NS_ADDREF(*aResult = lf); - return NS_OK; - } - - nsCAutoString carg; - NS_CopyUnicodeToNative(aArgument, carg); - - nsCAutoString wd; - rv = mWorkingDir->GetNativePath(wd); - NS_ENSURE_SUCCESS(rv, rv); - - BDirectory bwd(wd.get()); - - BPath resolved(&bwd, carg.get(), true); - if (resolved.InitCheck() != B_OK) - return NS_ERROR_FAILURE; - - rv = lf->InitWithNativePath(nsDependentCString(resolved.Path())); - if (NS_FAILED(rv)) return rv; - - NS_ADDREF(*aResult = lf); - return NS_OK; - #elif defined(XP_UNIX) nsCOMPtr lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); NS_ENSURE_TRUE(lf, NS_ERROR_OUT_OF_MEMORY); diff --git a/toolkit/components/filepicker/Makefile.in b/toolkit/components/filepicker/Makefile.in index 43e5d2de5e71..a91b09f89163 100644 --- a/toolkit/components/filepicker/Makefile.in +++ b/toolkit/components/filepicker/Makefile.in @@ -44,7 +44,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk ifdef MOZ_XUL -ifeq (,$(filter android qt beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) +ifeq (,$(filter android qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) DIRS = public src endif endif diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in index 841a77b01509..e3539d70a2fe 100644 --- a/toolkit/library/Makefile.in +++ b/toolkit/library/Makefile.in @@ -234,10 +234,6 @@ ifdef MOZ_ENABLE_LIBPROXY EXTRA_DSO_LDOPTS += $(MOZ_LIBPROXY_LIBS) endif -ifeq ($(OS_ARCH),BeOS) -EXTRA_DSO_LDOPTS += -lbe -ltracker -endif - ifeq ($(OS_ARCH),SunOS) ifdef GNU_CC EXTRA_DSO_LDOPTS += -lelf diff --git a/toolkit/library/libxul-config.mk b/toolkit/library/libxul-config.mk index 39a67e535302..2082aff51cee 100644 --- a/toolkit/library/libxul-config.mk +++ b/toolkit/library/libxul-config.mk @@ -245,7 +245,7 @@ COMPONENT_LIBS += \ $(NULL) endif -ifeq (,$(filter android qt beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) +ifeq (,$(filter android qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) ifdef MOZ_XUL COMPONENT_LIBS += fileview DEFINES += -DMOZ_FILEVIEW @@ -295,7 +295,7 @@ endif endif # Platform-specific icon channel stuff - supported mostly-everywhere -ifneq (,$(filter beos windows os2 mac cocoa gtk2 qt,$(MOZ_WIDGET_TOOLKIT))) +ifneq (,$(filter windows os2 mac cocoa gtk2 qt,$(MOZ_WIDGET_TOOLKIT))) DEFINES += -DICON_DECODER COMPONENT_LIBS += imgicon endif @@ -313,9 +313,6 @@ COMPONENT_LIBS += gkgfxthebes ifeq (windows,$(MOZ_WIDGET_TOOLKIT)) COMPONENT_LIBS += gkwidget endif -ifeq (beos,$(MOZ_WIDGET_TOOLKIT)) -COMPONENT_LIBS += widget_beos -endif ifeq (os2,$(MOZ_WIDGET_TOOLKIT)) COMPONENT_LIBS += wdgtos2 endif diff --git a/toolkit/library/nsStaticXULComponents.cpp b/toolkit/library/nsStaticXULComponents.cpp index 3f58cea3f3eb..959f4628b6b9 100644 --- a/toolkit/library/nsStaticXULComponents.cpp +++ b/toolkit/library/nsStaticXULComponents.cpp @@ -71,8 +71,6 @@ # define WIDGET_MODULES MODULE(nsWidgetModule) #elif defined(XP_MACOSX) # define WIDGET_MODULES MODULE(nsWidgetMacModule) -#elif defined(XP_BEOS) -# define WIDGET_MODULES MODULE(nsWidgetBeOSModule) #elif defined(XP_OS2) # define WIDGET_MODULES MODULE(nsWidgetOS2Module) #elif defined(MOZ_WIDGET_GTK2) diff --git a/toolkit/mozapps/installer/package-name.mk b/toolkit/mozapps/installer/package-name.mk index e306f2de65cf..e25835a017ba 100644 --- a/toolkit/mozapps/installer/package-name.mk +++ b/toolkit/mozapps/installer/package-name.mk @@ -74,25 +74,6 @@ endif ifeq ($(OS_ARCH),OS2) MOZ_PKG_PLATFORM := os2 endif -ifeq ($(OS_ARCH),BeOS) -ifeq (,$(filter-out 6.%, $(OS_RELEASE))) -MOZ_PKG_PLATFORM := Zeta -else -ifeq (,$(filter-out 5.1, $(OS_RELEASE))) -MOZ_PKG_PLATFORM := BeOS-bone -else -ifeq (,$(filter-out 5.0.4, $(OS_RELEASE))) -MOZ_PKG_PLATFORM := BeOS-bone -else -ifeq (,$(filter-out 5.0, $(OS_RELEASE))) -MOZ_PKG_PLATFORM := BeOS-net_server -else -MOZ_PKG_PLATFORM := BeOS-$(OS_RELEASE) -endif # 5.0 -endif # 5.0.4 -endif # 5.1 -endif # 6. -endif # OS_ARCH BeOS endif #MOZ_PKG_PLATFORM ifdef MOZ_PKG_SPECIAL diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index 554ef91c5d88..f8d10dbdb462 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -46,7 +46,7 @@ ifndef MOZ_PKG_FORMAT ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) MOZ_PKG_FORMAT = DMG else -ifeq (,$(filter-out OS2 WINNT WINCE BeOS, $(OS_ARCH))) +ifeq (,$(filter-out OS2 WINNT WINCE, $(OS_ARCH))) MOZ_PKG_FORMAT = ZIP else ifeq (,$(filter-out SunOS, $(OS_ARCH))) @@ -444,10 +444,6 @@ GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE) ifeq ($(OS_ARCH),IRIX) STRIP_FLAGS = -f endif -ifeq ($(OS_ARCH),BeOS) -STRIP_FLAGS = -g -PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "$(MOZ_PKG_APPNAME)-bin" -endif ifeq ($(OS_ARCH),OS2) STRIP = $(MOZILLA_DIR)/toolkit/mozapps/installer/os2/strip.cmd STRIP_FLAGS = diff --git a/toolkit/profile/src/nsToolkitProfileService.cpp b/toolkit/profile/src/nsToolkitProfileService.cpp index 610f0cd6dae2..eaf989fb2fec 100644 --- a/toolkit/profile/src/nsToolkitProfileService.cpp +++ b/toolkit/profile/src/nsToolkitProfileService.cpp @@ -43,9 +43,6 @@ #include #include #endif -#ifdef XP_BEOS -#include -#endif #ifdef XP_UNIX #include #endif @@ -954,14 +951,6 @@ XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult) return NS_NewLocalFile(nsDependentString(fullPath), PR_TRUE, aResult); -#elif defined(XP_BEOS) - BPath fullPath; - if (fullPath.SetTo(aPath, NULL, true)) - return NS_ERROR_FAILURE; - - return NS_NewNativeLocalFile(nsDependentCString(fullPath.Leaf()), PR_TRUE, - aResult); - #else #error Platform-specific logic needed here. #endif diff --git a/toolkit/toolkit-makefiles.sh b/toolkit/toolkit-makefiles.sh index 46ae6b48778f..912476161676 100644 --- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -473,7 +473,6 @@ MAKEFILES_widget=" widget/Makefile widget/public/Makefile widget/src/Makefile - widget/src/beos/Makefile widget/src/build/Makefile widget/src/gtk2/Makefile widget/src/gtkxtbin/Makefile @@ -733,7 +732,6 @@ MAKEFILES_libpr0n=" modules/libpr0n/decoders/icon/mac/Makefile modules/libpr0n/decoders/icon/win/Makefile modules/libpr0n/decoders/icon/gtk/Makefile - modules/libpr0n/decoders/icon/beos/Makefile modules/libpr0n/encoders/Makefile modules/libpr0n/encoders/png/Makefile modules/libpr0n/encoders/jpeg/Makefile diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in index 3cff081fd120..fcd85658481d 100644 --- a/toolkit/xre/Makefile.in +++ b/toolkit/xre/Makefile.in @@ -98,9 +98,6 @@ else ifeq ($(MOZ_WIDGET_TOOLKIT),os2) CPPSRCS += nsNativeAppSupportOS2.cpp else -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -CPPSRCS += nsNativeAppSupportBeOS.cpp -else ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) CPPSRCS += nsNativeAppSupportUnix.cpp else diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index ac8e9affdc9a..7591b30893f6 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -163,13 +163,6 @@ using mozilla::dom::ContentParent; #include #endif -#ifdef XP_BEOS -// execv() behaves bit differently in R5 and Zeta, looks unreliable in such situation -//#include -#include -#include -#endif //XP_BEOS - #ifdef XP_WIN #ifndef WINCE #include @@ -1615,18 +1608,6 @@ XRE_GetBinaryPath(const char* argv0, nsILocalFile* *aResult) if (NS_FAILED(rv)) return rv; -#elif defined(XP_BEOS) - int32 cookie = 0; - image_info info; - - if(get_next_image_info(0, &cookie, &info) != B_OK) - return NS_ERROR_FAILURE; - - rv = NS_NewNativeLocalFile(nsDependentCString(info.name), PR_TRUE, - getter_AddRefs(lf)); - if (NS_FAILED(rv)) - return rv; - #else #error Oops, you need platform-specific code here #endif @@ -1795,12 +1776,6 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative, #elif defined(XP_UNIX) if (execv(exePath.get(), gRestartArgv) == -1) return NS_ERROR_FAILURE; -#elif defined(XP_BEOS) - extern char **environ; - status_t res; - res = resume_thread(load_image(gRestartArgc,(const char **)gRestartArgv,(const char **)environ)); - if (res != B_OK) - return NS_ERROR_FAILURE; #else PRProcess* process = PR_CreateProcess(exePath.get(), gRestartArgv, nsnull, nsnull); diff --git a/toolkit/xre/nsNativeAppSupportBeOS.cpp b/toolkit/xre/nsNativeAppSupportBeOS.cpp deleted file mode 100644 index 717c61cc06a5..000000000000 --- a/toolkit/xre/nsNativeAppSupportBeOS.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla Browser. - * - * The Initial Developer of the Original Code is - * Fredrik Holmqvist . - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -//This define requires DebugConsole (see BeBits.com) to be installed -//#define DC_PROGRAMNAME "firefox-bin" -# ifdef DC_PROGRAMNAME -#include -#endif - -#include "nsIServiceManager.h" -#include "nsNativeAppSupportBase.h" -#include "nsICommandLineRunner.h" -#include "nsCOMPtr.h" -#include "nsIProxyObjectManager.h" -//#include "nsIBrowserDOMWindow.h" -#include "nsPIDOMWindow.h" -#include "nsIDOMChromeWindow.h" -#include "nsIWindowMediator.h" -#include "nsXPIDLString.h" -#include "nsIBaseWindow.h" -#include "nsIWidget.h" -#include "nsIDocShell.h" - -#include -#include -#include -#include -#include -#include - -// Two static helpers for future - if we decide to use OpenBrowserWindow, like we do in SeaMonkey -static nsresult -GetMostRecentWindow(const PRUnichar* aType, nsIDOMWindowInternal** aWindow) -{ - nsresult rv; - nsCOMPtr med(do_GetService( NS_WINDOWMEDIATOR_CONTRACTID, &rv)); - if (NS_FAILED(rv)) - return rv; - - if (med) - { - nsCOMPtr medProxy; - rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, NS_GET_IID(nsIWindowMediator), - med, NS_PROXY_SYNC | NS_PROXY_ALWAYS, - getter_AddRefs(medProxy)); - if (NS_FAILED(rv)) - return rv; - return medProxy->GetMostRecentWindow( aType, aWindow ); - } - return NS_ERROR_FAILURE; -} - -static nsresult -ActivateWindow(nsIDOMWindowInternal* aWindow) -{ - nsCOMPtr window(do_QueryInterface(aWindow)); - NS_ENSURE_TRUE(window, NS_ERROR_FAILURE); - nsCOMPtr baseWindow(do_QueryInterface(window->GetDocShell())); - NS_ENSURE_TRUE(baseWindow, NS_ERROR_FAILURE); - nsCOMPtr mainWidget; - baseWindow->GetMainWidget(getter_AddRefs(mainWidget)); - NS_ENSURE_TRUE(mainWidget, NS_ERROR_FAILURE); - BWindow *bwindow = (BWindow *)(mainWidget->GetNativeData(NS_NATIVE_WINDOW)); - if (bwindow) - bwindow->Activate(true); - return NS_OK; -} -//End static helpers - -class nsNativeAppSupportBeOS : public nsNativeAppSupportBase -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSINATIVEAPPSUPPORT - static void HandleCommandLine( int32 argc, char **argv, PRUint32 aState); -}; // nsNativeAppSupportBeOS - - -class nsBeOSApp : public BApplication -{ -public: - nsBeOSApp(sem_id sem) : BApplication( GetAppSig() ), init(sem), mMessage(NULL) - {} - - ~nsBeOSApp() - { - delete mMessage; - } - - void ReadyToRun() - { - release_sem(init); - } - - static int32 Main( void *args ) - { - nsBeOSApp *app = new nsBeOSApp((sem_id)args); - if (app == NULL) - return B_ERROR; - return app->Run(); - } - - void ArgvReceived(int32 argc, char **argv) - { - if (IsLaunching()) - { -#ifdef DC_PROGRAMNAME - TRACE("ArgvReceived Launching\n"); -#endif - return; - } - PRInt32 aState = /*IsLaunching() ? - nsICommandLine::STATE_INITIAL_LAUNCH :*/ - nsICommandLine::STATE_REMOTE_AUTO; - nsNativeAppSupportBeOS::HandleCommandLine(argc, argv, aState); - } - - void RefsReceived(BMessage* msg) - { -#ifdef DC_PROGRAMNAME - TRACE("RefsReceived\n"); -#endif - if (IsLaunching()) - { - mMessage = new BMessage(*msg); - return; - } - BPath path; - entry_ref er; - for (uint32 i = 0; msg->FindRef("refs", i, &er) == B_OK; i++) - { - int Argc = 2; - char **Argv = new char*[ 3 ]; - BEntry entry(&er, true); - BEntry fentry(GetAppFile(), false); - entry.GetPath(&path); - - Argv[0] = strdup( GetAppFile() ? GetAppFile() : "" ); - Argv[1] = strdup( path.Path() ? path.Path() : "" ); - // Safety measure - Argv[2] = 0; - // Is started, call ArgReceived, delete mArgv, else store for future usage - // after ::Enable() was called - ArgvReceived(2, Argv); - Argc = 0; - delete [] Argv; - Argv = NULL; - } - } - - void MessageReceived(BMessage* msg) - { - // BMessage from nsNativeAppBeOS::Enable() received. - // Services are ready, so we can supply stored refs - if (msg->what == 'enbl' && mMessage) - { -#ifdef DC_PROGRAMNAME - TRACE("enbl received"); -#endif - be_app_messenger.SendMessage(mMessage); - } - // Processing here file drop events from BWindow - // - until we implement native DnD in widget. - else if (msg->what == B_SIMPLE_DATA) - { - RefsReceived(msg); - } - else - BApplication::MessageReceived(msg); - } -private: - char *GetAppSig() - { - image_info info; - int32 cookie = 0; - BFile file; - BAppFileInfo appFileInfo; - static char sig[B_MIME_TYPE_LENGTH]; - - sig[0] = 0; - if (get_next_image_info(0, &cookie, &info) == B_OK && - file.SetTo(info.name, B_READ_ONLY) == B_OK && - appFileInfo.SetTo(&file) == B_OK && - appFileInfo.GetSignature(sig) == B_OK) - return sig; - - return "application/x-vnd.Mozilla"; - } - - char *GetAppFile() - { - image_info info; - int32 cookie = 0; - if (get_next_image_info(0, &cookie, &info) == B_OK && strlen(info.name) > 0) - return info.name; - - return ""; - } - - sem_id init; - BMessage *mMessage; -}; //class nsBeOSApp - -// Create and return an instance of class nsNativeAppSupportBeOS. -nsresult -NS_CreateNativeAppSupport(nsINativeAppSupport **aResult) -{ - if (!aResult) - return NS_ERROR_NULL_POINTER; - - nsNativeAppSupportBeOS *pNative = new nsNativeAppSupportBeOS; - if (!pNative) - return NS_ERROR_OUT_OF_MEMORY; - - *aResult = pNative; - NS_ADDREF(*aResult); - return NS_OK; -} - -NS_IMPL_ISUPPORTS1(nsNativeAppSupportBeOS, nsINativeAppSupport) - - -void -nsNativeAppSupportBeOS::HandleCommandLine(int32 argc, char **argv, PRUint32 aState) -{ - nsresult rv; - // Here we get stuck when starting from file-click or "OpenWith". - // No cmdLine or any other service can be created - // To workaround the problem, we store arguments if IsLaunching() - // and using this after ::Enable() was called. - nsCOMPtr cmdLine(do_CreateInstance("@mozilla.org/toolkit/command-line;1")); - if (!cmdLine) - { -#ifdef DC_PROGRAMNAME - TRACE("Couldn't create command line!"); -#endif - return; - } - - // nsICommandLineRunner::Init() should be called from main mozilla thread - // but we are at be_app thread. Using proxy to switch thread - nsCOMPtr cmdLineProxy; - rv = NS_GetProxyForObject( NS_PROXY_TO_MAIN_THREAD, NS_GET_IID(nsICommandLineRunner), - cmdLine, NS_PROXY_ASYNC | NS_PROXY_ALWAYS, getter_AddRefs(cmdLineProxy)); - if (rv != NS_OK) - { -#ifdef DC_PROGRAMNAME - TRACE("Couldn't get command line Proxy!"); -#endif - return; - } - - // nsICommandLineRunner::Init(,,workingdir,) requires some folder to be provided - // but that's unclear if we need it, so using 0 instead atm - rv = cmdLine->Init(argc, argv, 0 , aState); - if (rv != NS_OK) - { -#ifdef DC_PROGRAMNAME - TRACE("Couldn't init command line!"); -#endif - return; - } - - nsCOMPtr navWin; - GetMostRecentWindow( NS_LITERAL_STRING( "navigator:browser" ).get(), - getter_AddRefs(navWin )); - if (navWin) - { -# ifdef DC_PROGRAMNAME - TRACE("GotNavWin!"); -# endif - cmdLine->SetWindowContext(navWin); - } - -// TODO: try to use OpenURI here if there is navWin, maybe using special function -// OpenBrowserWindow which calls OpenURI like we do for SeaMonkey, -// else let CommandLineRunner to do its work. -// Problem with current implementation is unsufficient tabbed browsing support - cmdLineProxy->Run(); -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::Start(PRBool *aResult) -{ - NS_ENSURE_ARG(aResult); - NS_ENSURE_TRUE(be_app == NULL, NS_ERROR_NOT_INITIALIZED); - sem_id initsem = create_sem(0, "Mozilla BApplication init"); - if (initsem < B_OK) - return NS_ERROR_FAILURE; - thread_id tid = spawn_thread(nsBeOSApp::Main, "Mozilla XUL BApplication", B_NORMAL_PRIORITY, (void *)initsem); -#ifdef DC_PROGRAMNAME - TRACE("BeApp created"); -#endif - *aResult = PR_TRUE; - if (tid < B_OK || B_OK != resume_thread(tid)) - *aResult = PR_FALSE; - - if (B_OK != acquire_sem(initsem)) - *aResult = PR_FALSE; - - if (B_OK != delete_sem(initsem)) - *aResult = PR_FALSE; - return *aResult == PR_TRUE ? NS_OK : NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::Stop(PRBool *aResult) -{ - NS_ENSURE_ARG(aResult); - NS_ENSURE_TRUE(be_app, NS_ERROR_NOT_INITIALIZED); - - *aResult = PR_TRUE; - return NS_OK; -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::Quit() -{ - if (be_app->Lock()) - { - be_app->Quit(); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::ReOpen() -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::Enable() -{ - // Informing be_app that UI and services are ready to use. - if (be_app) - { - be_app_messenger.SendMessage('enbl'); - } - return NS_OK; -} - -NS_IMETHODIMP -nsNativeAppSupportBeOS::OnLastWindowClosing() -{ - return NS_OK; -} diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp index 024bca84289d..f00e392c3fc3 100644 --- a/toolkit/xre/nsSigHandlers.cpp +++ b/toolkit/xre/nsSigHandlers.cpp @@ -70,15 +70,6 @@ #include #endif -#ifdef XP_BEOS -#include -#include -#include "nsCOMPtr.h" -#include "nsIServiceManager.h" -#include "nsIAppStartup.h" -#include "nsToolkitCompsCID.h" -#endif - static char _progname[1024] = "huh?"; static unsigned int _gdb_sleep_duration = 300; @@ -148,26 +139,6 @@ child_ah_crap_handler(int signum) #endif // CRAWL_STACK_ON_SIGSEGV -#ifdef XP_BEOS -void beos_signal_handler(int signum) { -#ifdef DEBUG - fprintf(stderr, "beos_signal_handler: %d\n", signum); -#endif - nsresult rv; - nsCOMPtr appStartup(do_GetService(NS_APPSTARTUP_CONTRACTID, &rv)); - if (NS_FAILED(rv)) { - // Failed to get the appstartup service so shutdown the hard way -#ifdef DEBUG - fprintf(stderr, "beos_signal_handler: appShell->do_GetService() failed\n"); -#endif - exit(13); - } - - // Exit the appshell so that the app can shutdown normally - appStartup->Quit(nsIAppStartup::eAttemptQuit); -} -#endif - #ifdef MOZ_WIDGET_GTK2 // Need this include for version test below. #include @@ -351,10 +322,6 @@ void InstallSignalHandlers(const char *ProgramName) } #endif //SOLARIS -#ifdef XP_BEOS - signal(SIGTERM, beos_signal_handler); -#endif - #if defined(MOZ_WIDGET_GTK2) && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6)) const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK"); if (assertString && diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index 971fde3fe64c..8439e5574c20 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -69,7 +69,7 @@ # include # define INCL_DOSFILEMGR # include -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) # include #endif diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index bbef3cacc322..1e2c88528c34 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -78,10 +78,6 @@ #ifdef XP_MACOSX #include "nsILocalFileMac.h" #endif -#ifdef XP_BEOS -#include -#include -#endif #ifdef XP_UNIX #include #endif @@ -1095,17 +1091,6 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsILocalFile** aFile, PRBool aLocal) *strrchr(appDir, '\\') = '\0'; rv = NS_NewNativeLocalFile(nsDependentCString(appDir), PR_TRUE, getter_AddRefs(localDir)); } -#elif defined(XP_BEOS) - char appDir[MAXPATHLEN]; - if (find_directory(B_USER_SETTINGS_DIRECTORY, NULL, true, appDir, MAXPATHLEN)) - return NS_ERROR_FAILURE; - - int len = strlen(appDir); - appDir[len] = '/'; - appDir[len+1] = '\0'; - - rv = NS_NewNativeLocalFile(nsDependentCString(appDir), PR_TRUE, - getter_AddRefs(localDir)); #elif defined(XP_UNIX) const char* homeDir = getenv("HOME"); if (!homeDir || !*homeDir) @@ -1282,7 +1267,7 @@ nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) nsresult rv; -#if defined (XP_MACOSX) || defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS) +#if defined (XP_MACOSX) || defined(XP_WIN) || defined(XP_OS2) static const char* const sXR = "Mozilla"; rv = aFile->AppendNative(nsDependentCString(sXR)); @@ -1331,7 +1316,7 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile) } NS_ENSURE_SUCCESS(rv, rv); -#elif defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS) +#elif defined(XP_WIN) || defined(XP_OS2) if (gAppData->profile) { rv = AppendProfileString(aFile, gAppData->profile); } diff --git a/uriloader/exthandler/Makefile.in b/uriloader/exthandler/Makefile.in index b3f851dde174..0d5d6183a7b4 100644 --- a/uriloader/exthandler/Makefile.in +++ b/uriloader/exthandler/Makefile.in @@ -57,9 +57,6 @@ else ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) OSDIR = mac else -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -OSDIR = beos -else ifeq ($(MOZ_WIDGET_TOOLKIT),android) OSDIR = android else @@ -117,10 +114,6 @@ OSHELPER += nsGNOMERegistry.cpp OSHELPER += nsMIMEInfoUnix.cpp endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -OSHELPER += nsMIMEInfoBeOS.cpp -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),windows) OSHELPER += nsMIMEInfoWin.cpp LOCAL_INCLUDES += -I$(srcdir)/win diff --git a/uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp b/uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp deleted file mode 100644 index 1d5799a8307d..000000000000 --- a/uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsOSHelperAppService.cpp. - * - * The Initial Developer of the Original Code is - * Paul Ashford. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Christian Biesinger - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#include "nsMIMEInfoBeOS.h" -#include "nsILocalFile.h" - -nsMIMEInfoBeOS::~nsMIMEInfoBeOS() -{ -} - -nsresult -nsMIMEInfoBeOS::LaunchDefaultWithFile(nsIFile* aFile) -{ - // Launch the file, unless it is an executable. - nsCOMPtr local(do_QueryInterface(aFile)); - if (!local) - return NS_ERROR_FAILURE; - - PRBool executable = PR_TRUE; - local->IsExecutable(&executable); - if (executable) - return NS_ERROR_FAILURE; - - return local->Launch(); -} - -nsresult -nsMIMEInfoBeOS::LoadUriInternal(nsIURI * aURL) -{ - nsresult rv = NS_OK; - - if (aURL) { - // Get the Protocol - nsCAutoString scheme; - aURL->GetScheme(scheme); - BString protoStr(scheme.get()); - protoStr.Prepend("application/x-vnd.Be.URL."); - // Get the Spec - nsCAutoString spec; - aURL->GetAsciiSpec(spec); - const char* args[] = { spec.get() }; - - //Launch the app - BMimeType protocol; - bool isInstalled = false; - if (protocol.SetTo(protoStr.String()) == B_OK) - { - if(protocol.IsInstalled()) - { - isInstalled = true; - be_roster->Launch(protoStr.String(), NS_ARRAY_LENGTH(args), (char **)args); - } - } - if ((!isInstalled) && (!strcmp("mailto", scheme.get()))) - be_roster->Launch("text/x-email", NS_ARRAY_LENGTH(args), (char **)args); - } - return rv; -} diff --git a/uriloader/exthandler/beos/nsMIMEInfoBeOS.h b/uriloader/exthandler/beos/nsMIMEInfoBeOS.h deleted file mode 100644 index 748b5a4eacd2..000000000000 --- a/uriloader/exthandler/beos/nsMIMEInfoBeOS.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the BeOS MIME Info Implementation. - * - * The Initial Developer of the Original Code is - * Christian Biesinger . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsMIMEInfoBeOS_h_ -#define nsMIMEInfoBeOS_h_ - -#include "nsMIMEInfoImpl.h" - -class nsMIMEInfoBeOS : public nsMIMEInfoImpl { - public: - nsMIMEInfoBeOS(const char* aType = "") : nsMIMEInfoImpl(aType) {} - nsMIMEInfoBeOS(const nsACString& aMIMEType) : nsMIMEInfoImpl(aMIMEType) {} - nsMIMEInfoBeOS(const nsACString& aType, HandlerClass aClass) : - nsMIMEInfoImpl(aType, aClass) {} - virtual ~nsMIMEInfoBeOS(); - - protected: - virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile); - virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI); -}; - -#endif diff --git a/uriloader/exthandler/beos/nsOSHelperAppService.cpp b/uriloader/exthandler/beos/nsOSHelperAppService.cpp deleted file mode 100644 index 083faf76ee3e..000000000000 --- a/uriloader/exthandler/beos/nsOSHelperAppService.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsOSHelperAppService.cpp. - * - * The Initial Developer of the Original Code is - * Paul Ashford. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsOSHelperAppService.h" -#include "nsMIMEInfoBeOS.h" -#include "nsISupports.h" -#include "nsString.h" -#include "nsXPIDLString.h" -#include "nsIURL.h" -#include "nsILocalFile.h" -#include "nsIProcess.h" -#include "prenv.h" // for PR_GetEnv() -#include // for system() - -#include -#include -#include -#include -#include -#include - -#define LOG(args) PR_LOG(mLog, PR_LOG_DEBUG, args) -#define LOG_ENABLED() PR_LOG_TEST(mLog, PR_LOG_DEBUG) - -nsOSHelperAppService::nsOSHelperAppService() : nsExternalHelperAppService() -{ -} - -nsOSHelperAppService::~nsOSHelperAppService() -{} - -nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, PRBool * aHandlerExists) -{ - LOG(("-- nsOSHelperAppService::OSProtocolHandlerExists for '%s'\n", - aProtocolScheme)); - // look up the protocol scheme in the MIME database - *aHandlerExists = PR_FALSE; - if (aProtocolScheme && *aProtocolScheme) - { - BString protoStr(aProtocolScheme); - protoStr.Prepend("application/x-vnd.Be.URL."); - BMimeType protocol; - if (protocol.SetTo(protoStr.String()) == B_OK) - { - if (protocol.IsInstalled()) - *aHandlerExists = PR_TRUE; - } - if ((!*aHandlerExists) && (!strcmp("mailto", aProtocolScheme))) - { - // mailto link, no x-vnd.Be.URL.mailto entry - if (protocol.SetTo("text/x-email") == B_OK) - { - if (protocol.IsInstalled()) - *aHandlerExists = PR_TRUE; - } - } - } - - return NS_OK; -} - - -nsresult nsOSHelperAppService::SetMIMEInfoForType(const char *aMIMEType, nsMIMEInfoBeOS**_retval) { - - LOG(("-- nsOSHelperAppService::SetMIMEInfoForType: %s\n",aMIMEType)); - - nsresult rv = NS_ERROR_FAILURE; - - nsMIMEInfoBeOS* mimeInfo = new nsMIMEInfoBeOS(aMIMEType); - if (mimeInfo) { - NS_ADDREF(mimeInfo); - BMimeType mimeType(aMIMEType); - BMessage data; - int32 index = 0; - BString strData; - LOG((" Adding extensions:\n")); - if (mimeType.GetFileExtensions(&data) == B_OK) { - while (data.FindString("extensions",index,&strData) == B_OK) { - // if the file extension includes the '.' then we don't want to include that when we append - // it to the mime info object. - if (strData.ByteAt(0) == '.') - strData.RemoveFirst("."); - mimeInfo->AppendExtension(nsDependentCString(strData.String())); - LOG((" %s\n",strData.String())); - index++; - } - } - - char desc[B_MIME_TYPE_LENGTH + 1]; - if (mimeType.GetShortDescription(desc) == B_OK) { - mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(desc)); - } else { - if (mimeType.GetLongDescription(desc) == B_OK) { - mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(desc)); - } else { - mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(aMIMEType)); - } - } - - LOG((" Description: %s\n",desc)); - - //set preferred app and app description - char appSig[B_MIME_TYPE_LENGTH + 1]; - bool doSave = true; - if (mimeType.GetPreferredApp(appSig) == B_OK) { - LOG((" Got preferred ap\n")); - BMimeType app(appSig); - entry_ref ref; - BEntry entry; - BPath path; - if ((app.GetAppHint(&ref) == B_OK) && - (entry.SetTo(&ref, false) == B_OK) && - (entry.GetPath(&path) == B_OK)) { - - LOG((" Got our path!\n")); - nsCOMPtr handlerFile; - rv = GetFileTokenForPath(NS_ConvertUTF8toUTF16(path.Path()).get(), getter_AddRefs(handlerFile)); - - if (NS_SUCCEEDED(rv)) { - mimeInfo->SetDefaultApplication(handlerFile); - mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); - mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(path.Leaf())); - LOG((" Preferred App: %s\n",path.Leaf())); - doSave = false; - } - } - } - if (doSave) { - mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk); - LOG((" No Preferred App\n")); - } - - *_retval = mimeInfo; - rv = NS_OK; - } - else - rv = NS_ERROR_FAILURE; - - return rv; -} - -nsresult nsOSHelperAppService::GetMimeInfoFromExtension(const char *aFileExt, - nsMIMEInfoBeOS ** _retval) { - // if the extension is null, return immediately - if (!aFileExt || !*aFileExt) - return NS_ERROR_INVALID_ARG; - - LOG(("Here we do an extension lookup for '%s'\n", aFileExt)); - - BMimeType mimeType; - - if (BMimeType::GuessMimeType(aFileExt, &mimeType) == B_OK) - return SetMIMEInfoForType(mimeType.Type(), _retval); - - // Extension not found - return NS_ERROR_FAILURE; -} - -nsresult nsOSHelperAppService::GetMimeInfoFromMIMEType(const char *aMIMEType, - nsMIMEInfoBeOS ** _retval) { - // if the mime type is null, return immediately - if (!aMIMEType || !*aMIMEType) - return NS_ERROR_INVALID_ARG; - - LOG(("Here we do a mimetype lookup for '%s'\n", aMIMEType)); - - BMimeType mimeType(aMIMEType); - if (mimeType.IsInstalled()) - return SetMIMEInfoForType(aMIMEType, _retval); - - return NS_ERROR_FAILURE; -} - -already_AddRefed -nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, const nsACString& aFileExt, PRBool* aFound) -{ - *aFound = PR_TRUE; - nsMIMEInfoBeOS* mi = nsnull; - const nsCString& flatType = PromiseFlatCString(aMIMEType); - const nsCString& flatExt = PromiseFlatCString(aFileExt); - GetMimeInfoFromMIMEType(flatType.get(), &mi); - if (mi) - return mi; - - GetMimeInfoFromExtension(flatExt.get(), &mi); - if (mi && !aMIMEType.IsEmpty()) - mi->SetMIMEType(aMIMEType); - if (mi) - return mi; - - *aFound = PR_FALSE; - mi = new nsMIMEInfoBeOS(flatType); - if (!mi) - return nsnull; - NS_ADDREF(mi); - if (!aFileExt.IsEmpty()) - mi->AppendExtension(aFileExt); - - return mi; -} - -NS_IMETHODIMP -nsOSHelperAppService::GetProtocolHandlerInfoFromOS(const nsACString &aScheme, - PRBool *found, - nsIHandlerInfo **_retval) -{ - NS_ASSERTION(!aScheme.IsEmpty(), "No scheme was specified!"); - - nsresult rv = OSProtocolHandlerExists(nsPromiseFlatCString(aScheme).get(), - found); - if (NS_FAILED(rv)) - return rv; - - nsMIMEInfoBeOS *handlerInfo = - new nsMIMEInfoBeOS(aScheme, nsMIMEInfoBase::eProtocolInfo); - NS_ENSURE_TRUE(handlerInfo, NS_ERROR_OUT_OF_MEMORY); - NS_ADDREF(*_retval = handlerInfo); - - if (!*found) { - // Code that calls this requires an object regardless if the OS has - // something for us, so we return the empty object. - return rv; - } - - nsAutoString desc; - GetApplicationDescription(aScheme, desc); - handlerInfo->SetDefaultDescription(desc); - - return rv; -} - diff --git a/uriloader/exthandler/beos/nsOSHelperAppService.h b/uriloader/exthandler/beos/nsOSHelperAppService.h deleted file mode 100644 index 784658cf6746..000000000000 --- a/uriloader/exthandler/beos/nsOSHelperAppService.h +++ /dev/null @@ -1,71 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsOSHelperAppService.h. - * - * The Initial Developer of the Original Code is - * Paul Ashford. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsOSHelperAppService_h__ -#define nsOSHelperAppService_h__ - -// The OS helper app service is a subclass of nsExternalHelperAppService and is implemented on each -// platform. It contains platform specific code for finding helper applications for a given mime type -// in addition to launching those applications. - -#include "nsExternalHelperAppService.h" -#include "nsCExternalHandlerService.h" -#include "nsMIMEInfoImpl.h" -#include "nsCOMPtr.h" - -class nsMIMEInfoBeOS; - -class nsOSHelperAppService : public nsExternalHelperAppService -{ -public: - nsOSHelperAppService(); - virtual ~nsOSHelperAppService(); - - already_AddRefed GetMIMEInfoFromOS(const nsACString& aMIMEType, const nsACString& aFileExt, PRBool *aFound); - NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString &aScheme, - PRBool *found, - nsIHandlerInfo **_retval); - - // override nsIExternalProtocolService methods - nsresult OSProtocolHandlerExists(const char * aProtocolScheme, PRBool * aHandlerExists); - -protected: - nsresult SetMIMEInfoForType(const char *aMIMEType, nsMIMEInfoBeOS **_retval); - nsresult GetMimeInfoFromExtension(const char *aFileExt, nsMIMEInfoBeOS **_retval); - nsresult GetMimeInfoFromMIMEType(const char *aMIMEType, nsMIMEInfoBeOS **_retval); -}; - -#endif // nsOSHelperAppService_h__ diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index d7cf64e204d1..30383b9e7a8b 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -78,10 +78,6 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),os2) EXPORTS += nsIDragSessionOS2.h endif -ifeq ($(MOZ_WIDGET_TOOLKIT),beos) -EXPORTS += nsIDragSessionBeOS.h -endif - ifeq ($(MOZ_WIDGET_TOOLKIT),android) EXPORTS += \ nsIPrintDialogService.h \ diff --git a/widget/public/nsIDragSessionBeOS.h b/widget/public/nsIDragSessionBeOS.h deleted file mode 100644 index eb35f83cf058..000000000000 --- a/widget/public/nsIDragSessionBeOS.h +++ /dev/null @@ -1,61 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsMime.cpp for the BeOS port of Mozilla. - * - * The Initial Developer of the Original Code is - * Paul Ashford. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Paul Ashford - * Fredrik Holmqvist - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsIDragSessionBeOS_h__ -#define nsIDragSessionBeOS_h__ - - -#include "nsISupports.h" - -#include - - -#define NS_IDRAGSESSIONBEOS_IID \ -{ 0x36c4c381, 0x09e3, 0x11d4, { 0xb0, 0x33, 0xa4, 0x20, 0xf4, 0x2c, 0xfd, 0x7c } }; - -class nsIDragSessionBeOS : public nsISupports -{ - public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDRAGSESSIONBEOS_IID) - NS_IMETHOD TransmitData( BMessage *aNegotiationReply) = 0; - NS_IMETHOD UpdateDragMessageIfNeeded(BMessage *aDragMessage) = 0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDragSessionBeOS, NS_IDRAGSESSIONBEOS_IID) - -#endif diff --git a/widget/src/Makefile.in b/widget/src/Makefile.in index f0dbde3728f8..2ac259e2545b 100644 --- a/widget/src/Makefile.in +++ b/widget/src/Makefile.in @@ -46,7 +46,7 @@ MODULE = widget DIRS = shared xpwidgets -ifneq (,$(filter beos os2 cocoa qt android,$(MOZ_WIDGET_TOOLKIT))) +ifneq (,$(filter os2 cocoa qt android,$(MOZ_WIDGET_TOOLKIT))) DIRS += $(MOZ_WIDGET_TOOLKIT) endif diff --git a/widget/src/beos/Makefile.in b/widget/src/beos/Makefile.in deleted file mode 100644 index d9baa1ef67d9..000000000000 --- a/widget/src/beos/Makefile.in +++ /dev/null @@ -1,94 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = widget -LIBRARY_NAME = widget_beos -EXPORT_LIBRARY = 1 -IS_COMPONENT = 1 -MODULE_NAME = nsWidgetBeOSModule -GRE_MODULE = 1 -LIBXUL_LIBRARY = 1 - - -CPPSRCS = \ - nsAppShell.cpp \ - nsBidiKeyboard.cpp \ - nsClipboard.cpp \ - nsDragService.cpp \ - nsFilePicker.cpp \ - nsLookAndFeel.cpp \ - nsSound.cpp \ - nsToolkit.cpp \ - nsWidgetFactory.cpp \ - nsWindow.cpp \ - nsPopupWindow.cpp \ - nsChildView.cpp \ - nsScreenBeOS.cpp \ - nsScreenManagerBeOS.cpp \ - nsDeviceContextSpecB.cpp \ - nsPrintOptionsBeOS.cpp \ - $(NULL) - -SHARED_LIBRARY_LIBS = $(DIST)/lib/libxpwidgets_s.a - -EXTRA_DSO_LDOPTS = \ - -ltracker \ - -lgame \ - $(TOOLKIT_DSO_LDOPTS) \ - $(MOZ_COMPONENT_LIBS) \ - -lgkgfx \ - $(TK_LIBS) \ - -lthebes \ - $(NULL) - -include $(topsrcdir)/config/rules.mk - -DEFINES += -D_IMPL_NS_WIDGET -I$(srcdir)/../xpwidgets -I$(srcdir) - -CXXFLAGS += $(TK_CFLAGS) - -INCLUDES += \ - -I$(srcdir)/../xpwidgets \ - -I$(srcdir) \ - $(NULL) diff --git a/widget/src/beos/nsAppShell.cpp b/widget/src/beos/nsAppShell.cpp deleted file mode 100644 index 36fded7da941..000000000000 --- a/widget/src/beos/nsAppShell.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Duncan Wilcox - * Yannick Koehler - * Makoto Hamanaka - * Fredrik Holmqvist - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsAppShell.h" -#include "nsSwitchToUIThread.h" -#include "prprf.h" - -#include -#include - -//------------------------------------------------------------------------- -// -// nsAppShell constructor -// -//------------------------------------------------------------------------- -nsAppShell::nsAppShell() - : is_port_error(false), scheduled (false) -{ - eventport = -1; // 0 is legal value for port_id! -} - - -//------------------------------------------------------------------------- -// -// Create the application shell -// -//------------------------------------------------------------------------- - -NS_IMETHODIMP nsAppShell::Init() -{ - // system wide unique names - // NOTE: this needs to be run from within the main application thread - - char portname[B_OS_NAME_LENGTH]; - PR_snprintf(portname, sizeof(portname), "event%lx", (long unsigned) PR_GetCurrentThread()); - -#ifdef DEBUG - printf("nsAppShell::Create portname: %s\n", portname); -#endif - - // Clean up things. Restart process in toolkit may leave old port alive. - if ((eventport = find_port(portname)) >= 0) - { - close_port(eventport); - delete_port(eventport); - } - - eventport = create_port(200, portname); - return nsBaseAppShell::Init(); -} - - - -//------------------------------------------------------------------------- -// -// nsAppShell destructor -// -//------------------------------------------------------------------------- -nsAppShell::~nsAppShell() -{ - close_port(eventport); - delete_port(eventport); - - if (be_app->Lock()) - { - be_app->Quit(); - } -} - -PRBool nsAppShell::ProcessNextNativeEvent(PRBool mayWait) -{ - bool gotMessage = false; - - // should we check for eventport initialization ? - if (eventport < 0) - { - char portname[B_OS_NAME_LENGTH]; - PR_snprintf(portname, sizeof(portname), "event%lx", (long unsigned) PR_GetCurrentThread()); - // XXX - Do we really need to search eventport every time? There is one istance of AppShell per app - // and finding it once in Init() might be sufficient. - if((eventport = find_port(portname)) < 0) - { - // not initialized -#ifdef DEBUG - printf("nsAppShell::DispatchNativeEvent() was called before init\n"); -#endif - return gotMessage; - } - } - - // Currently we ignoring event type, previously we had 5 priority levels, different for mouse, kbd etc. - // MS Windows code sets some priority for kbd and IME events by ignoring mayWait - - if (port_count(eventport)) - gotMessage = InvokeBeOSMessage(0); - - // There is next message in port queue - if (port_count(eventport) && !mayWait) - { - if (!scheduled) - { - // There is new (not scheduled) event and we cannot wait. - // So inform AppShell about existence of new event. - // Actually it should be called from something like BLooper::MessageReceived(), - // or, in our case, in nsToolkit CallMethod*() - NativeEventCallback(); - } - else - { - scheduled = false; - gotMessage = InvokeBeOSMessage(0); - } - } - // Hack. Emulating logic for mayWait. - // Allow next event to pass through (if it appears inside 100000 uS) - // Actually it should block and then be unblocked from independent thread - // In that case read_port() should be used. - if (mayWait) - gotMessage = InvokeBeOSMessage(100000); - return gotMessage; -} -//------------------------------------------------------------------------- - -void nsAppShell::ScheduleNativeEventCallback() -{ - if (eventport < 0) - return; - port_info portinfo; - if (get_port_info(eventport, &portinfo) != B_OK) - return; - if (port_count(eventport) < portinfo.capacity - 20) - { - // This should be done from different thread in reality in order to unblock - ThreadInterfaceData id; - id.data = 0; - id.waitingThread = find_thread(NULL); - write_port_etc(eventport, 'natv', &id, sizeof(id), B_TIMEOUT, 1000000); - scheduled = true; - } -} - -bool nsAppShell::InvokeBeOSMessage(bigtime_t timeout) -{ - int32 code; - ThreadInterfaceData id; - if (read_port_etc(eventport, &code, &id, sizeof(id), B_TIMEOUT, timeout) < 0) - { - is_port_error = true; - return false; - } - - id.waitingThread = 0; - MethodInfo *mInfo = (MethodInfo *)id.data; - if (code != 'natv') - mInfo->Invoke(); - - if (id.waitingThread != 0) - resume_thread(id.waitingThread); - delete mInfo; - return true; -} \ No newline at end of file diff --git a/widget/src/beos/nsAppShell.h b/widget/src/beos/nsAppShell.h deleted file mode 100644 index c43d9d79f8c8..000000000000 --- a/widget/src/beos/nsAppShell.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsAppShell_h__ -#define nsAppShell_h__ - -#include "nsBaseAppShell.h" -#include - -struct ThreadInterfaceData -{ - void* data; - thread_id waitingThread; -}; - -struct EventItem -{ - int32 code; - ThreadInterfaceData ifdata; -}; - -struct MethodInfo; - -/** - * Native BeOS Application shell wrapper - */ - -class nsAppShell : public nsBaseAppShell -{ - public: - nsAppShell(); - nsresult Init(); -protected: - virtual void ScheduleNativeEventCallback(); - virtual PRBool ProcessNextNativeEvent(PRBool mayWait); - virtual ~nsAppShell(); - -private: - port_id eventport; - volatile bool scheduled; - bool is_port_error; - bool InvokeBeOSMessage(bigtime_t timeout); -}; - -#endif // nsAppShell_h__ diff --git a/widget/src/beos/nsBeOSCursors.h b/widget/src/beos/nsBeOSCursors.h deleted file mode 100644 index 78b0ee3d924f..000000000000 --- a/widget/src/beos/nsBeOSCursors.h +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Yannick Koehler - * Paul Ashford - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsBeOSCursors_h__ -#define nsBeOSCursors_h__ - -#include - - -static unsigned char cursorHyperlink[] = {16,1,2,2, -0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, -8,1,60,33,76,113,66,113,48,249,12,249,2,0,1,0, -0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, -15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248 -}; - -static unsigned char cursorHelp[] = {16,1,2,2, -0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, -8,1,60,121,76,205,66,25,48,49,12,49,2,0,1,48, -0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, -15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248 -}; - -static unsigned char cursorCrosshair[] = {16,1,8,8, -0,0,0,128,0,128,0,128,0,128,0,128,0,128,0,128, -127,255,0,128,0,128,0,128,0,128,0,128,0,128,0,128, -0,0,0,128,0,128,0,128,0,128,0,128,0,128,0,128, -127,255,0,128,0,128,0,128,0,128,0,128,0,128,0,128 -}; - -static unsigned char cursorCopy[] = {16,1,2,2, -0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, -8,1,60,1,76,1,66,17,48,17,12,125,2,17,1,16, -0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, -15,255,63,255,127,255,127,255,63,255,15,255,3,255,1,248 -}; - -static unsigned char cursorAlias[] = {16,1,2,2, -0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, -8,1,60,1,76,113,66,137,48,157,12,137,2,65,1,0, -0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, -15,255,63,255,127,255,127,255,63,255,15,255,3,255,1,248 -}; - -static unsigned char cursorGrabbing[] = {16,1,8,2, -0,0,0,0,0,0,0,0,15,224,18,92,33,42,40,1, -60,1,20,1,18,1,8,1,4,1,2,1,1,0,0,128, -0,0,0,0,0,0,0,0,15,224,31,252,63,254,63,255, -63,255,31,255,31,255,15,255,7,255,3,255,1,254,0,248 -}; - -static unsigned char cursorGrab[] = {16,1,2,2, -0,0,0,0,59,64,36,168,36,148,18,74,18,74,9,37, -8,1,60,1,76,1,68,1,48,1,12,1,2,0,1,0, -0,0,0,0,59,64,63,232,63,252,31,254,31,254,15,255, -15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248 -}; - -static unsigned char cursorLowerRight[] = {16,1,13,13, -0,0,0,0,0,0,0,0,0,0,4,6,2,38,1,38, -0,166,0,102,3,230,0,6,0,6,7,254,7,254,0,0, -0,0,0,0,0,0,0,0,4,15,14,127,7,127,3,255, -1,255,7,255,7,255,7,255,15,255,15,255,15,255,15,255 -}; - -static unsigned char cursorLowerLeft[] = {16,1,13,2, -0,0,0,0,0,0,0,0,0,0,96,32,100,64,100,128, -101,0,102,0,103,192,96,0,96,0,127,224,127,224,0,0, -0,0,0,0,0,0,0,0,240,32,254,112,254,224,255,192, -255,128,255,224,255,224,255,224,255,240,255,240,255,240,255,240 -}; - -static unsigned char cursorUpperLeft[] = {16,1,2,2, -0,0,127,224,127,224,96,0,96,0,103,192,102,0,101,0, -100,128,100,64,96,32,0,0,0,0,0,0,0,0,0,0, -255,240,255,240,255,240,255,240,255,224,255,224,255,224,255,128, -255,192,254,224,254,112,240,32,0,0,0,0,0,0,0,0 -}; - -static unsigned char cursorUpperRight[] = {16,1,2,13, -0,0,7,254,7,254,0,6,0,6,3,230,0,102,0,166, -1,38,2,38,4,6,0,0,0,0,0,0,0,0,0,0, -15,255,15,255,15,255,15,255,7,255,7,255,7,255,1,255, -3,255,7,127,14,127,4,15,0,0,0,0,0,0,0,0 -}; - -static unsigned char cursorRight[] = {16,1,6,13, -0,0,0,6,0,6,1,6,0,134,0,70,15,230,0,70, -0,134,1,6,0,6,0,6,0,0,0,0,0,0,0,0, -0,15,0,15,1,15,3,143,1,207,31,239,31,255,31,239, -1,207,3,143,1,15,0,15,0,15,0,0,0,0,0,0 -}; - -static unsigned char cursorLeft[] = {16,1,6,2, -0,0,96,0,96,0,96,128,97,0,98,0,103,224,98,0, -97,0,96,128,96,0,96,0,0,0,0,0,0,0,0,0, -240,0,240,0,240,128,241,192,243,128,247,240,255,240,247,240, -243,128,241,192,240,128,240,0,240,0,0,0,0,0,0,0 -}; - -static unsigned char cursorTop[] = {16,1,2,7, -0,0,63,248,63,248,0,0,0,0,1,0,3,128,5,64, -9,32,1,0,1,0,0,0,0,0,0,0,0,0,0,0, -127,252,127,252,127,252,127,252,1,0,3,128,7,192,15,224, -31,240,11,160,3,128,3,128,0,0,0,0,0,0,0,0 -}; - -static unsigned char cursorBottom[] = {16,1,13,7, -0,0,0,0,0,0,0,0,0,0,1,0,1,0,9,32, -5,64,3,128,1,0,0,0,0,0,63,248,63,248,0,0, -0,0,0,0,0,0,0,0,3,128,3,128,11,160,31,240, -15,224,7,192,3,128,1,0,127,252,127,252,127,252,127,252 -}; - -static unsigned char cursorHorizontalDrag[] = {16,1,7,7, -1,128,1,128,1,128,1,128,1,128,17,136,49,140,125,190, -125,190,49,140,17,136,1,128,1,128,1,128,1,128,1,128, -3,192,3,192,3,192,3,192,27,216,59,220,127,254,255,255, -255,255,127,254,59,220,27,216,3,192,3,192,3,192,3,192 -}; - -static unsigned char cursorVerticalDrag[] = {16,1,7,7, -0,0,1,128,3,192,7,224,1,128,1,128,0,0,255,255, -255,255,0,0,1,128,1,128,7,224,3,192,1,128,0,0, -1,128,3,192,7,224,15,240,15,240,3,192,255,255,255,255, -255,255,255,255,3,192,15,240,15,240,7,224,3,192,1,128 -}; - -static unsigned char cursorCell[] = {16,1,2,2, -0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, -8,1,60,49,76,49,66,205,48,205,12,49,2,49,1,0, -0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, -15,255,63,255,127,255,127,255,63,255,15,255,3,255,1,248 -}; - -static unsigned char cursorZoomIn[] = {16,1,5,6, -15,128,16,64,32,32,66,16,66,16,79,144,66,16,66,16, -32,32,16,112,15,184,0,28,0,14,0,7,0,2,0,0, -15,128,31,192,63,224,127,240,127,240,127,240,127,240,127,240, -63,224,31,240,15,184,0,28,0,14,0,7,0,2,0,0 -}; - -static unsigned char cursorZoomOut[] = {16,1,5,6, -15,128,16,64,32,32,64,16,64,16,79,144,64,16,64,16, -32,32,16,112,15,184,0,28,0,14,0,7,0,2,0,0, -15,128,31,192,63,224,127,240,127,240,127,240,127,240,127,240, -63,224,31,240,15,184,0,28,0,14,0,7,0,2,0,0 -}; - -static unsigned char cursorWatch2[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,138,2,146,1,130,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -#if 0 -// keeping these in case we want to animate the spinner at some point -static unsigned char cursorWatch1[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,86,4,146,2,146,1,130,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch3[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,130,2,158,1,130,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch4[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,130,2,146,1,138,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch5[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,130,2,146,1,146,0,213, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch6[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,130,2,146,1,162,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch7[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,130,2,242,1,130,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; - -static unsigned char cursorWatch8[] = {16,1,0,1, -112,0,72,0,72,0,39,192,36,184,18,84,16,2,120,2, -152,2,132,2,96,58,24,70,4,162,2,146,1,130,0,197, -112,0,120,0,120,0,63,192,63,248,31,252,31,254,127,254, -255,254,255,254,127,254,31,254,7,254,3,254,1,254,0,255 -}; -#endif - -#endif // nsBeOSCursors_h__ - diff --git a/widget/src/beos/nsBidiKeyboard.cpp b/widget/src/beos/nsBidiKeyboard.cpp deleted file mode 100644 index 25572f07fa56..000000000000 --- a/widget/src/beos/nsBidiKeyboard.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is IBM code. - * - * The Initial Developer of the Original Code is - * IBM. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Simon Montagu - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsBidiKeyboard.h" - -NS_IMPL_ISUPPORTS1(nsBidiKeyboard, nsIBidiKeyboard) - -nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard() -{ -} - -nsBidiKeyboard::~nsBidiKeyboard() -{ -} - -NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL) -{ - *aIsRTL = PR_FALSE; - // XXX Insert platform specific code to determine keyboard direction - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel) -{ - // XXX Insert platform specific code to set keyboard language - return NS_ERROR_NOT_IMPLEMENTED; -} diff --git a/widget/src/beos/nsBidiKeyboard.h b/widget/src/beos/nsBidiKeyboard.h deleted file mode 100644 index 1283ecf776ed..000000000000 --- a/widget/src/beos/nsBidiKeyboard.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is IBM code. - * - * The Initial Developer of the Original Code is - * IBM. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Simon Montagu - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef __nsBidiKeyboard -#define __nsBidiKeyboard -#include "nsIBidiKeyboard.h" - -class nsBidiKeyboard : public nsIBidiKeyboard -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIBIDIKEYBOARD - - nsBidiKeyboard(); - virtual ~nsBidiKeyboard(); - /* additional members */ -}; - - -#endif // __nsBidiKeyboard diff --git a/widget/src/beos/nsCList.h b/widget/src/beos/nsCList.h deleted file mode 100644 index ebd26b995d7a..000000000000 --- a/widget/src/beos/nsCList.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef CLIST_H -#define CLIST_H - -#include - -// ----------------------------------------------------------------------- -// -// Simple circular linked-list implementation... -// -// ----------------------------------------------------------------------- - -// Foreward declarations... -struct CList; - -#define OBJECT_PTR_FROM_CLIST(className, listElement) \ - ((char*)listElement - offsetof(className, m_link)) - - -struct CList { - CList *next; - CList *prev; - - CList() { - next = prev = this; - } - - ~CList() { - Remove(); - } - - // - // Append an element to the end of this list - // - void Append(CList &element) { - element.next = this; - element.prev = prev; - prev->next = &element; - prev = &element; - } - - // - // Add an element to the beginning of this list - // - void Add(CList &element) { - element.next = next; - element.prev = this; - next->prev = &element; - next = &element; - } - - // - // Append this element to the end of a list - // - void AppendToList(CList &list) { - list.Append(*this); - } - - // - // Add this element to the beginning of a list - // - void AddToList(CList &list) { - list.Add(*this); - } - - // - // Remove this element from the list and re-initialize - // - void Remove(void) { - prev->next = next; - next->prev = prev; - - next = prev = this; - } - - // - // Is this list empty ? - // - bool IsEmpty(void) { - return (next == this); - } -}; - -#endif // CLIST_H - diff --git a/widget/src/beos/nsChildView.cpp b/widget/src/beos/nsChildView.cpp deleted file mode 100644 index 06aea6a8d2c8..000000000000 --- a/widget/src/beos/nsChildView.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla Browser. - * - * The Initial Developer of the Original Code is - * Fredrik Holmqvist . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsChildView.h" - -nsChildView::nsChildView() : nsWindow() -{ -} - - -nsresult nsChildView::Create(nsIWidget *aParent, - nsNativeWidget aNativeParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIAppShell *aAppShell, - nsIToolkit *aToolkit, - nsWidgetInitData *aInitData) -{ - - NS_ASSERTION(aInitData->mWindowType == eWindowType_child - || aInitData->mWindowType == eWindowType_plugin, - "The windowtype is not handled by this class." ); - - mIsTopWidgetWindow = PR_FALSE; - - BaseCreate(aParent, aRect, aHandleEventFunction, aContext, aAppShell, - aToolkit, aInitData); - - mListenForResizes = aNativeParent ? PR_TRUE : aInitData->mListenForResizes; - - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - nsToolkit* toolkit = (nsToolkit *)mToolkit; - if (toolkit && !toolkit->IsGuiThread()) - { - uint32 args[7]; - args[0] = (uint32)aParent; - args[1] = (uint32)&aRect; - args[2] = (uint32)aHandleEventFunction; - args[3] = (uint32)aContext; - args[4] = (uint32)aAppShell; - args[5] = (uint32)aToolkit; - args[6] = (uint32)aInitData; - - if (nsnull != aParent) - { - // nsIWidget parent dispatch - MethodInfo info(this, this, nsSwitchToUIThread::CREATE, 7, args); - toolkit->CallMethod(&info); - } - else - { - // Native parent dispatch - MethodInfo info(this, this, nsSwitchToUIThread::CREATE_NATIVE, 7, args); - toolkit->CallMethod(&info); - } - return NS_OK; - } - - mParent = aParent; - // Useful shortcut, wondering if we can use it also in GetParent() instead - // nsIWidget* type mParent. - mWindowParent = (nsWindow *) aParent; - SetBounds(aRect); - - //NS_NATIVE_GRAPHIC maybe? - //Parent may be a BView if we embed. - BView *parent= (BView *) - (aParent ? aParent->GetNativeData(NS_NATIVE_WIDGET) : aNativeParent); - //There seems to be three of these on startup, - //but I believe that these are because of bugs in - //other code as they existed before rewriting this - //function. - NS_PRECONDITION(parent, "Childviews without parents don't get added to anything."); - // A childview that is never added to a parent is very strange. - if (!parent) - return NS_ERROR_FAILURE; - - mView = new nsViewBeOS(this, - BRect(aRect.x, aRect.y, aRect.x + aRect.width - 1, aRect.y + aRect.height - 1) - , "Child view", 0, B_WILL_DRAW); -#if defined(BeIME) - mView->SetFlags(mView->Flags() | B_INPUT_METHOD_AWARE); -#endif - bool mustUnlock = parent->Parent() && parent->LockLooper(); - parent->AddChild(mView); - if (mustUnlock) - parent->UnlockLooper(); - DispatchStandardEvent(NS_CREATE); - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Hide or show this component -// -//------------------------------------------------------------------------- -NS_METHOD nsChildView::Show(PRBool bState) -{ - if (!mEnabled) - return NS_OK; - - if (!mView || !mView->LockLooper()) - return NS_OK; - - //We need to do the IsHidden() checks - //because BeOS counts no of Hide() - //and Show() checks. BeBook: - // For a hidden view to become visible again, the number of Hide() calls - // must be matched by an equal number of Show() calls. - if (PR_FALSE == bState) - { - if (!mView->IsHidden()) - mView->Hide(); - } - else - { - if (mView->IsHidden()) - mView->Show(); - } - - mView->UnlockLooper(); - mIsVisible = bState; - return NS_OK; -} - - -NS_METHOD nsChildView::SetTitle(const nsAString& aTitle) -{ - if (mView) - mView->SetName(NS_ConvertUTF16toUTF8(aTitle).get()); - return NS_OK; -} - diff --git a/widget/src/beos/nsChildView.h b/widget/src/beos/nsChildView.h deleted file mode 100644 index 66facca3eb20..000000000000 --- a/widget/src/beos/nsChildView.h +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla Browser. - * - * The Initial Developer of the Original Code is - * Fredrik Holmqvist . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsChildView_h__ -#define nsChildView_h__ - -#include "nsWindow.h" - -class nsChildView : public nsWindow -{ -public: - nsChildView(); - virtual PRBool IsChild() { return(PR_TRUE); }; - - NS_IMETHOD Show(PRBool bState); - NS_IMETHOD SetTitle(const nsAString& aTitle); -}; -#endif //nsChildView_h__ diff --git a/widget/src/beos/nsClipboard.cpp b/widget/src/beos/nsClipboard.cpp deleted file mode 100644 index b2427728ca48..000000000000 --- a/widget/src/beos/nsClipboard.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * Takashi Toyoshima - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsClipboard.h" -#include "nsCOMPtr.h" -#include "nsITransferable.h" -#include "nsWidgetsCID.h" -#include "nsXPIDLString.h" -#include "nsPrimitiveHelpers.h" -#include "nsXPCOM.h" -#include "nsISupportsPrimitives.h" -#include "nsString.h" - -#include -#include -#include - -// The class statics: -BView *nsClipboard::sView = 0; - -#if defined(DEBUG_akkana) || defined(DEBUG_mcafee) || defined(DEBUG_toyoshim) -# define DEBUG_CLIPBOARD -#endif - - -//------------------------------------------------------------------------- -// -// nsClipboard constructor -// -//------------------------------------------------------------------------- -nsClipboard::nsClipboard() : nsBaseClipboard() -{ -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::nsClipboard()\n"); -#endif /* DEBUG_CLIPBOARD */ - - mIgnoreEmptyNotification = PR_FALSE; - mClipboardOwner = nsnull; - mTransferable = nsnull; -} - -//------------------------------------------------------------------------- -// -// nsClipboard destructor -// -//------------------------------------------------------------------------- -nsClipboard::~nsClipboard() -{ -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::~nsClipboard()\n"); -#endif /* DEBUG_CLIPBOARD */ -} - -void nsClipboard::SetTopLevelView(BView *v) -{ - // Don't set up any more event handlers if we're being called twice - // for the same toplevel widget - if (sView == v) - return; - - if (sView != 0 && sView->Window() != 0) - return; - - if(v == 0 || v->Window() == 0) - { -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::SetTopLevelView: widget passed in is null or has no window!\n"); -#endif /* DEBUG_CLIPBOARD */ - return; - } - -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::SetTopLevelView\n"); -#endif /* DEBUG_CLIPBOARD */ -} - -// -// The copy routine -// -NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) -{ - mIgnoreEmptyNotification = PR_TRUE; - -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::SetNativeClipboardData()\n"); -#endif /* DEBUG_CLIPBOARD */ - - // make sure we have a good transferable - if (nsnull == mTransferable) { -#ifdef DEBUG_CLIPBOARD - printf(" SetNativeClipboardData: no transferable!\n"); -#endif /* DEBUG_CLIPBOARD */ - return NS_ERROR_FAILURE; - } - - // lock the native clipboard - if (!be_clipboard->Lock()) - return NS_ERROR_FAILURE; - - // clear the native clipboard - nsresult rv = NS_OK; - if (B_OK == be_clipboard->Clear()) { - // set data to the native clipboard - if (BMessage *msg = be_clipboard->Data()) { - // Get the transferable list of data flavors - nsCOMPtr dfList; - mTransferable->FlavorsTransferableCanExport(getter_AddRefs(dfList)); - - // Walk through flavors that contain data and register them - // into the BMessage as supported flavors - PRUint32 i; - PRUint32 cnt; - dfList->Count(&cnt); - for (i = 0; i < cnt && rv == NS_OK; i++) { - nsCOMPtr genericFlavor; - dfList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr currentFlavor (do_QueryInterface(genericFlavor)); - if (currentFlavor) { - nsXPIDLCString flavorStr; - currentFlavor->ToString(getter_Copies(flavorStr)); - -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: %d/%d = %s\n", i, cnt, (const char *)flavorStr); -#endif /* DEBUG_CLIPBOARD */ - if (0 == strncmp(flavorStr, "text/", 5)) { - // [NS] text/ * => [Be] text/ * - void *data = nsnull; - PRUint32 dataSize = 0; - nsCOMPtr genericDataWrapper; - rv = mTransferable->GetTransferData(flavorStr, getter_AddRefs(genericDataWrapper), &dataSize); - nsPrimitiveHelpers::CreateDataFromPrimitive(flavorStr, genericDataWrapper, &data, dataSize); -#ifdef DEBUG_CLIPBOARD - if (NS_FAILED(rv)) - printf("nsClipboard: Error getting data from transferable\n"); -#endif /* DEBUG_CLIPBOARD */ - if (dataSize && data != nsnull) { - NS_ConvertUTF16toUTF8 cv((const PRUnichar *)data, (PRUint32)dataSize / 2); - const char *utf8Str = cv.get(); - uint32 utf8Len = strlen(utf8Str); -#ifdef DEBUG_CLIPBOARD - if (0 == strcmp(flavorStr, kUnicodeMime)) - printf(" => [%s]%s\n", kTextMime, utf8Str); - else - printf(" => [%s]%s\n", (const char *)flavorStr, utf8Str); -#endif /* DEBUG_CLIPBOARD */ - status_t rc; - if (0 == strcmp(flavorStr, kUnicodeMime)) { - // [NS] text/unicode => [Be] text/plain - rc = msg->AddData(kTextMime, B_MIME_TYPE, (void *)utf8Str, utf8Len); - } else { - // [NS] text/ * => [Be] text/ * - rc = msg->AddData((const char *)flavorStr, B_MIME_TYPE, (void *)utf8Str, utf8Len); - } - if (rc != B_OK) - rv = NS_ERROR_FAILURE; - } else { -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: Error null data from transferable\n"); -#endif /* DEBUG_CLIPBOARD */ - // not fatal. force to continue... - rv = NS_OK; - } - } else { - // [NS] * / * => [Be] * / * - void *data = nsnull; - PRUint32 dataSize = 0; - nsCOMPtr genericDataWrapper; - rv = mTransferable->GetTransferData(flavorStr, getter_AddRefs(genericDataWrapper), &dataSize); - nsPrimitiveHelpers::CreateDataFromPrimitive(flavorStr, genericDataWrapper, &data, dataSize); -#ifdef DEBUG_CLIPBOARD - if (NS_FAILED(rv)) - printf("nsClipboard: Error getting data from transferable\n"); -#endif /* DEBUG_CLIPBOARD */ - if (dataSize && data != nsnull) { -#ifdef DEBUG_CLIPBOARD - printf("[%s](binary)\n", (const char *)flavorStr); -#endif /* DEBUG_CLIPBOARD */ - if (B_OK != msg->AddData((const char *)flavorStr, B_MIME_TYPE, data, dataSize)) - rv = NS_ERROR_FAILURE; - } - } - } else { -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: Error getting flavor\n"); -#endif /* DEBUG_CLIPBOARD */ - rv = NS_ERROR_FAILURE; - } - } /* for */ - } else { - rv = NS_ERROR_FAILURE; - } - } else { - rv = NS_ERROR_FAILURE; - } - if (B_OK != be_clipboard->Commit()) - rv = NS_ERROR_FAILURE; - be_clipboard->Unlock(); - - mIgnoreEmptyNotification = PR_FALSE; - - return rv; -} - - -// -// The blocking Paste routine -// -NS_IMETHODIMP -nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, PRInt32 aWhichClipboard ) -{ -#ifdef DEBUG_CLIPBOARD - printf(" nsClipboard::GetNativeClipboardData()\n"); -#endif /* DEBUG_CLIPBOARD */ - - // make sure we have a good transferable - if (nsnull == aTransferable) { - printf(" GetNativeClipboardData: Transferable is null!\n"); - return NS_ERROR_FAILURE; - } - - // get flavor list - nsresult rv; - nsCOMPtr flavorList; - rv = aTransferable->FlavorsTransferableCanImport(getter_AddRefs(flavorList)); - if (NS_FAILED(rv)) - return NS_ERROR_FAILURE; - - // get native clipboard data - if (!be_clipboard->Lock()) - return NS_ERROR_FAILURE; - - BMessage *msg = be_clipboard->Data(); - if (!msg) - return NS_ERROR_FAILURE; -#ifdef DEBUG_CLIPBOARD - msg->PrintToStream(); -#endif /* DEBUG_CLIPBOARD */ - - PRUint32 cnt; - flavorList->Count(&cnt); - for (PRUint32 i = 0; i < cnt; i++) { - nsCOMPtr genericFlavor; - flavorList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr currentFlavor(do_QueryInterface(genericFlavor)); - if (currentFlavor) { - nsXPIDLCString flavorStr; - currentFlavor->ToString(getter_Copies(flavorStr)); - -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: %d/%d = %s\n", i, cnt, (const char *)flavorStr); -#endif /* DEBUG_CLIPBOARD */ - const void *data; - ssize_t size; - if (0 == strncmp(flavorStr, "text/", 5)) { - // [Be] text/ * => [NS] text/ * - status_t rc; - if (0 == strcmp(flavorStr, kUnicodeMime)) - rc = msg->FindData(kTextMime, B_MIME_TYPE, &data, &size); - else - rc = msg->FindData(flavorStr, B_MIME_TYPE, &data, &size); - if (rc != B_OK || !data || !size) { -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: not found in BMessage\n"); -#endif /* DEBUG_CLIPBOARD */ - } else { - NS_ConvertUTF8toUTF16 ucs2Str((const char *)data, (PRUint32)size); - nsCOMPtr genericDataWrapper; - nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr, (void *)ucs2Str.get(), ucs2Str.Length() * 2, getter_AddRefs(genericDataWrapper)); - rv = aTransferable->SetTransferData(flavorStr, genericDataWrapper, ucs2Str.Length() * 2); - } - } else { - // [Be] * / * => [NS] * / * - if (B_OK != msg->FindData(flavorStr, B_MIME_TYPE, &data, &size)) { -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: not found in BMessage\n"); -#endif /* DEBUG_CLIPBOARD */ - } else { - nsCOMPtr genericDataWrapper; - nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr, (void *)data, (PRUint32)size, getter_AddRefs(genericDataWrapper)); - rv = aTransferable->SetTransferData(flavorStr, genericDataWrapper, size); - } - } -#ifdef DEBUG_CLIPBOARD - if (NS_FAILED(rv)) - printf("nsClipboard: Error SetTransferData\n"); -#endif /* DEBUG_CLIPBOARD */ - } else { - rv = NS_ERROR_FAILURE; -#ifdef DEBUG_CLIPBOARD - printf("nsClipboard: Error gerring flavor"); -#endif /* DEBUG_CLIPBOARD */ - } - if (rv != NS_OK) - break; - } /* for */ - - be_clipboard->Unlock(); - - return rv; -} diff --git a/widget/src/beos/nsClipboard.h b/widget/src/beos/nsClipboard.h deleted file mode 100644 index fc785d2bdb72..000000000000 --- a/widget/src/beos/nsClipboard.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Takashi Toyoshima - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsClipboard_h__ -#define nsClipboard_h__ - -#include "nsBaseClipboard.h" -#include - -class BView; -class nsITransferable; - -/** - * Native BeOS Clipboard wrapper - */ - -class nsClipboard : public nsBaseClipboard -{ - -public: - nsClipboard(); - virtual ~nsClipboard(); - - static void SetTopLevelView(BView *v); - - -protected: - NS_IMETHOD SetNativeClipboardData( PRInt32 aWhichClipboard ); - NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, PRInt32 aWhichClipboard); - - PRBool mIgnoreEmptyNotification; - - static BView *sView; -}; - -#endif // nsClipboard_h__ diff --git a/widget/src/beos/nsDeviceContextSpecB.cpp b/widget/src/beos/nsDeviceContextSpecB.cpp deleted file mode 100644 index 518c0ff424e0..000000000000 --- a/widget/src/beos/nsDeviceContextSpecB.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Roland Mainz - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIWidget.h" -#include "nsDeviceContextSpecB.h" - -#include "nsIPrefService.h" -#include "nsIPrefBranch.h" -#include "prenv.h" /* for PR_GetEnv */ -#include "nsIServiceManager.h" -#include "nsReadableUtils.h" -#include "nsStringEnumerator.h" -#include "nsTArray.h" -#include "nsCRT.h" - -//---------------------------------------------------------------------------------- -// The printer data is shared between the PrinterEnumerator and the nsDeviceContextSpecG -// The PrinterEnumerator creates the printer info -// but the nsDeviceContextSpecG cleans it up -// If it gets created (via the Page Setup Dialog) but the user never prints anything -// then it will never be delete, so this class takes care of that. -class GlobalPrinters { -public: - static GlobalPrinters* GetInstance() { return &mGlobalPrinters; } - ~GlobalPrinters() { FreeGlobalPrinters(); } - - void FreeGlobalPrinters(); - nsresult InitializeGlobalPrinters(); - - PRBool PrintersAreAllocated() { return mGlobalPrinterList != nsnull; } - PRUint32 GetNumPrinters() { return mGlobalNumPrinters; } - nsString* GetStringAt(PRInt32 aInx) { return &mGlobalPrinterList->ElementAt(aInx); } - -protected: - GlobalPrinters() {} - - static GlobalPrinters mGlobalPrinters; - static nsTArray* mGlobalPrinterList; - static PRUint32 mGlobalNumPrinters; - -}; -//--------------- -// static members -GlobalPrinters GlobalPrinters::mGlobalPrinters; -nsTArray* GlobalPrinters::mGlobalPrinterList = nsnull; -PRUint32 GlobalPrinters::mGlobalNumPrinters = 0; - -nsDeviceContextSpecBeOS::nsDeviceContextSpecBeOS() -{ -} - -nsDeviceContextSpecBeOS::~nsDeviceContextSpecBeOS() -{ -} - -NS_IMPL_ISUPPORTS1(nsDeviceContextSpecBeOS, nsIDeviceContextSpec) - -/** ------------------------------------------------------- - * Initialize the nsDeviceContextSpecBeOS - * @update dc 2/15/98 - * @update syd 3/2/99 - */ -NS_IMETHODIMP nsDeviceContextSpecBeOS::Init(nsIWidget *aWidget, - nsIPrintSettings* aPS, - PRBool aIsPrintPreview) -{ - nsresult rv = NS_ERROR_FAILURE; - NS_ASSERTION(nsnull != aPS, "No print settings."); - - mPrintSettings = aPS; - - // if there is a current selection then enable the "Selection" radio button - if (aPS != nsnull) { - PRBool isOn; - aPS->GetPrintOptions(nsIPrintSettings::kEnableSelectionRB, &isOn); - nsCOMPtr pPrefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv)) { - (void) pPrefs->SetBoolPref("print.selection_radio_enabled", isOn); - } - } - - rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters(); - if (NS_FAILED(rv)) { - return rv; - } - - - GlobalPrinters::GetInstance()->FreeGlobalPrinters(); - - return rv; -} - -/** ------------------------------------------------------- - * Closes the printmanager if it is open. - * @update dc 2/15/98 - */ -NS_IMETHODIMP nsDeviceContextSpecBeOS :: ClosePrintManager() -{ - return NS_OK; -} - -// Printer Enumerator -nsPrinterEnumeratorBeOS::nsPrinterEnumeratorBeOS() -{ -} - -NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorBeOS, nsIPrinterEnumerator) - -NS_IMETHODIMP nsPrinterEnumeratorBeOS::GetPrinterNameList(nsIStringEnumerator **aPrinterNameList) -{ - NS_ENSURE_ARG_POINTER(aPrinterNameList); - *aPrinterNameList = nsnull; - - nsresult rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters(); - if (NS_FAILED(rv)) { - return rv; - } - - PRUint32 numPrinters = GlobalPrinters::GetInstance()->GetNumPrinters(); - nsTArray *printers = new nsTArray(numPrinters); - if (!printers) { - GlobalPrinters::GetInstance()->FreeGlobalPrinters(); - return NS_ERROR_OUT_OF_MEMORY; - } - - PRUint32 count = 0; - while( count < numPrinters ) - { - printers->AppendElement(*GlobalPrinters::GetInstance()->GetStringAt(count++)); - } - GlobalPrinters::GetInstance()->FreeGlobalPrinters(); - - return NS_NewAdoptingStringEnumerator(aPrinterNameList, printers); -} - -/* readonly attribute wstring defaultPrinterName; */ -NS_IMETHODIMP nsPrinterEnumeratorBeOS::GetDefaultPrinterName(PRUnichar * *aDefaultPrinterName) -{ - NS_ENSURE_ARG_POINTER(aDefaultPrinterName); - *aDefaultPrinterName = nsnull; - return NS_OK; -} - -/* void initPrintSettingsFromPrinter (in wstring aPrinterName, in nsIPrintSettings aPrintSettings); */ -NS_IMETHODIMP nsPrinterEnumeratorBeOS::InitPrintSettingsFromPrinter(const PRUnichar *aPrinterName, nsIPrintSettings *aPrintSettings) -{ - return NS_OK; -} - -NS_IMETHODIMP nsPrinterEnumeratorBeOS::DisplayPropertiesDlg(const PRUnichar *aPrinter, nsIPrintSettings *aPrintSettings) -{ - return NS_OK; -} - -//---------------------------------------------------------------------- -nsresult GlobalPrinters::InitializeGlobalPrinters () -{ - if (PrintersAreAllocated()) - return NS_OK; - - mGlobalNumPrinters = 0; - - mGlobalPrinterList = new nsTArray(); - if (!mGlobalPrinterList) - return NS_ERROR_OUT_OF_MEMORY; - - /* add an entry for the default printer (see nsPostScriptObj.cpp) */ - mGlobalPrinterList->AppendElement( - nsString(NS_ConvertASCIItoUTF16(NS_POSTSCRIPT_DRIVER_NAME "default"))); - mGlobalNumPrinters++; - - /* get the list of printers */ - char *printerList = nsnull; - - /* the env var MOZILLA_PRINTER_LIST can "override" the prefs */ - printerList = PR_GetEnv("MOZILLA_PRINTER_LIST"); - - if (!printerList) { - nsresult rv; - nsCOMPtr pPrefs = do_GetService(NS_PREFSERVICE_CONTRACTID, - &rv); - if (NS_SUCCEEDED(rv)) { - (void) pPrefs->GetCharPref("print.printer_list", &printerList); - } - } - - if (printerList) { - char *tok_lasts; - char *name; - - /* PL_strtok_r() will modify the string - copy it! */ - printerList = strdup(printerList); - if (!printerList) - return NS_ERROR_OUT_OF_MEMORY; - - for( name = PL_strtok_r(printerList, " ", &tok_lasts) ; - name != nsnull ; - name = PL_strtok_r(nsnull, " ", &tok_lasts) ) - { - mGlobalPrinterList->AppendElement( - nsString(NS_ConvertASCIItoUTF16(NS_POSTSCRIPT_DRIVER_NAME)) + - nsString(NS_ConvertASCIItoUTF16(name))); - mGlobalNumPrinters++; - } - - NS_Free(printerList); - } - - if (mGlobalNumPrinters == 0) - return NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE; - - return NS_OK; -} - -//---------------------------------------------------------------------- -void GlobalPrinters::FreeGlobalPrinters() -{ - delete mGlobalPrinterList; - mGlobalPrinterList = nsnull; - mGlobalNumPrinters = 0; -} - - - - diff --git a/widget/src/beos/nsDeviceContextSpecB.h b/widget/src/beos/nsDeviceContextSpecB.h deleted file mode 100644 index c41a25126721..000000000000 --- a/widget/src/beos/nsDeviceContextSpecB.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Roland Mainz - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsDeviceContextSpecB_h___ -#define nsDeviceContextSpecB_h___ - -#include "nsCOMPtr.h" -#include "nsIDeviceContextSpec.h" -#include "nsIPrintSettings.h" -#include "nsIPrintOptions.h" -// For public interface? -#include "nsIWidget.h" -#include "nsPrintdBeOS.h" - -class nsDeviceContextSpecBeOS : public nsIDeviceContextSpec -{ -public: -/** - * Construct a nsDeviceContextSpecBeOS, which is an object which contains and manages a mac printrecord - * @update dc 12/02/98 - */ - nsDeviceContextSpecBeOS(); - - NS_DECL_ISUPPORTS - -/** - * Initialize the nsDeviceContextSpecBeOS for use. This will allocate a printrecord for use - * @update dc 2/16/98 - * @param aWidget Unused - * @param aPS Settings for this print job - * @param aIsPrintPreview Unused - * @return error status - */ - NS_IMETHOD Init(nsIWidget *aWidget, - nsIPrintSettings* aPS, - PRBool aIsPrintPreview); - - -/** - * Closes the printmanager if it is open. - * @update dc 2/13/98 - * @return error status - */ - NS_IMETHOD ClosePrintManager(); - - NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface) { - return NS_ERROR_NOT_IMPLEMENTED; - } - -/** - * Destructor for nsDeviceContextSpecBeOS, this will release the printrecord - * @update dc 2/16/98 - */ -protected: - virtual ~nsDeviceContextSpecBeOS(); - -public: - int InitializeGlobalPrinters(); - void FreeGlobalPrinters(); - -protected: - nsCOMPtr mPrintSettings; -}; - -//------------------------------------------------------------------------- -// Printer Enumerator -//------------------------------------------------------------------------- -class nsPrinterEnumeratorBeOS : public nsIPrinterEnumerator -{ -public: - nsPrinterEnumeratorBeOS(); - NS_DECL_ISUPPORTS - NS_DECL_NSIPRINTERENUMERATOR - -protected: -}; - -#endif diff --git a/widget/src/beos/nsDragService.cpp b/widget/src/beos/nsDragService.cpp deleted file mode 100644 index 661d2ec14e71..000000000000 --- a/widget/src/beos/nsDragService.cpp +++ /dev/null @@ -1,768 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * Paul Ashford - * Fredrik Holmqvist - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include "nsDragService.h" -#include "nsIDocument.h" -#include "nsIRegion.h" -#include "nsITransferable.h" -#include "nsIServiceManager.h" -#include "nsISupportsPrimitives.h" -#include "nsXPIDLString.h" -#include "nsPrimitiveHelpers.h" -#include "nsWidgetsCID.h" -#include "nsCRT.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "prlog.h" -#include "nsPresContext.h" -#include "nsIFrame.h" -#include "nsIView.h" -#include "nsIWidget.h" - -static NS_DEFINE_CID(kCDragServiceCID, NS_DRAGSERVICE_CID); - -static PRLogModuleInfo *sDragLm = NULL; - -static nsIFrame* -GetPrimaryFrameFor(nsIDOMNode *aDOMNode) -{ - nsCOMPtr aContent = do_QueryInterface(aDOMNode); - if (nsnull == aContent) - return nsnull; - - return aContent->GetPrimaryFrame(); -} - -static bool -IsInternalDrag(BMessage * aMsg) -{ - BString orig; - // We started this drag if originater is 'BeZilla' - return (nsnull != aMsg && B_OK == aMsg->FindString("be:originator", &orig) && - 0 == orig.Compare("BeZilla")); -} - -NS_IMPL_THREADSAFE_ISUPPORTS3(nsDragService, nsIDragService, nsIDragSession, nsIDragSessionBeOS) -//NS_IMPL_THREADSAFE_ISUPPORTS1(nsBaseDragService, nsIDragSessionBeOS) - -//------------------------------------------------------------------------- -// -// DragService constructor -// Enable logging: 'export NSPR_LOG_MODULES=nsDragService:5' -//------------------------------------------------------------------------- -nsDragService::nsDragService() -{ - // set up our logging module - if (!sDragLm) - sDragLm = PR_NewLogModule("nsDragService"); - PR_LOG(sDragLm, PR_LOG_DEBUG, ("\n\nnsDragService::nsDragService")); - - mDragMessage = NULL; - mCanDrop = PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// DragService destructor -// -//------------------------------------------------------------------------- -nsDragService::~nsDragService() -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::~nsDragService")); - ResetDragInfo(); -} - -//------------------------------------------------------------------------- -// -// nsIDragService : InvokeDragSession -// -// Called when a drag is being initiated from within mozilla -// The code here gets the BView, the dragRect, builds the DragMessage and -// starts the drag. -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::InvokeDragSession (nsIDOMNode *aDOMNode, - nsISupportsArray * aArrayTransferables, - nsIScriptableRegion * aRegion, - PRUint32 aActionType) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession")); - nsresult rv = nsBaseDragService::InvokeDragSession(aDOMNode, - aArrayTransferables, - aRegion, aActionType); - NS_ENSURE_SUCCESS(rv, rv); - - ResetDragInfo(); - // make sure that we have an array of transferables to use - if (nsnull == aArrayTransferables) - return NS_ERROR_INVALID_ARG; - - // set our reference to the transferables. this will also addref - // the transferables since we're going to hang onto this beyond the - // length of this call - mSourceDataItems = aArrayTransferables; - - // Get a box or a bitmap to drag - bool haveRect = false; - BRect dragRect; - - if (nsnull != aRegion) - { - PRInt32 aX, aY, aWidth, aHeight; - // TODO. Region may represent multiple rects - when dragging multiple items. - aRegion->GetBoundingBox(&aX, &aY, &aWidth, &aHeight); - dragRect.Set( aX, aY, aX + aWidth, aY + aHeight); - haveRect = true; - // does this need to be offset? - } - - // Get the frame for this content node (note: frames are not refcounted) - nsIFrame *aFrame = GetPrimaryFrameFor(aDOMNode); - if (nsnull == aFrame) - return PR_FALSE; - - // Now that we have the frame, we have to convert its coordinates into global screen - // coordinates. - nsRect aRect = aFrame->GetRect(); - - // Find offset from our view - nsIView *containingView = nsnull; - nsPoint viewOffset(0,0); - aFrame->GetOffsetFromView(viewOffset, &containingView); - NS_ASSERTION(containingView, "No containing view!"); - if (nsnull == containingView) - return PR_FALSE; - - // get the widget associated with the containing view. - nsPoint aWidgetOffset; - nsCOMPtr aWidget = containingView->GetNearestWidget(&aWidgetOffset); - if (nsnull == aWidget) - return PR_FALSE; - - BView *view = (BView *) aWidget->GetNativeData(NS_NATIVE_WIDGET); - // Don't have the rect yet, try to get it from the dom node - if (nsnull==haveRect) - { - float t2p = aFrame->GetPresContext()->TwipsToPixels(); - // GetOffsetFromWidget() actually returns the _parent's_ offset from its widget, so we - // still have to add in the offset to |containingView|'s parent ourselves. - nsPoint aViewPos = containingView->GetPosition(); - - // Shift our offset rect by offset into our view, the view's offset to its parent, and - // the parent's offset to the closest widget. Then convert that to global coordinates. - // Recall that WidgetToScreen() will give us the global coordinates of the rectangle we - // give it, but it expects everything to be in pixels. - nsRect screenOffset; - screenOffset.MoveBy ( NSTwipsToIntPixels(aWidgetOffset.x + aViewPos.x + viewOffset.x, t2p), - NSTwipsToIntPixels(aWidgetOffset.y + aViewPos.y + viewOffset.y, t2p)); - aWidget->WidgetToScreen ( screenOffset, screenOffset ); - - dragRect.Set(screenOffset.x, screenOffset.y, - screenOffset.x + NSTwipsToIntPixels(aRect.width, t2p), - screenOffset.y + NSTwipsToIntPixels(aRect.height, t2p)); - haveRect = true; - } - - mDragAction = aActionType; - mDragMessage = CreateDragMessage(); - - if (!view || !mDragMessage) - return PR_FALSE; - - // Set the original click location, how to get this or is it needed ? - // sourceMessage->AddPoint("click_location", mPoint); - - if (!view->LockLooper()) - return PR_FALSE; - - // Well, let's just use the view frame, maybe? - if (!haveRect) - { - dragRect = view->Frame(); - // do we need to offset? - } - - PR_LOG(sDragLm, PR_LOG_DEBUG, ("invoking mDragView->DragMessage")); - bool noBitmap = true; - -//This is the code for image-dragging, currently disabled. See comments in beginning of file. -# ifdef 0 - do - { - PRUint32 dataSize; - PRUint32 noItems; - mSourceDataItems->Count(&noItems); - if (noItems!=1) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Transferables are not ==1, no drag bitmap!")); - break; - } - - nsCOMPtr genericItem; - aArrayTransferables->GetElementAt(0, getter_AddRefs(genericItem)); - nsCOMPtr aTransferable (do_QueryInterface(genericItem)); - - nsCOMPtr genericDataWrapper; - nsresult rv = aTransferable->GetTransferData(kNativeImageMime, getter_AddRefs(genericDataWrapper), &dataSize); - if (NS_FAILED(rv)) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Could not get nativeimage, no drag bitmap!")); - break; - } - - nsCOMPtr ptrPrimitive (do_QueryInterface(genericDataWrapper)); - if (ptrPrimitive == NULL) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Could not get ptrPrimitive, no drag bitmap!")); - break; - } - - nsCOMPtr genericData; - ptrPrimitive->GetData(getter_AddRefs(genericData)); - if (genericData == NULL) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Could not get data, no drag bitmap!")); - break; - } - - //dependent on bug 294234 and how it's implemented. This code was for attachment 183634. - nsCOMPtr image (do_QueryInterface(genericData)); - if (image == NULL) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Could not get nsImage, no drag bitmap!")); - break; - } - - BBitmap *aBitmap; - image->GetBitmap(&aBitmap); - if (aBitmap==NULL || !aBitmap->IsValid()) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("Could not get BBitmap, no drag bitmap %s!", aBitmap==NULL?"(null)":"(not valid)" )); - break; - } - - view->DragMessage(mDragMessage, aBitmap, B_OP_OVER, BPoint(-4,-4), view); - noBitmap = false; - } while(false); -# endif - - if (noBitmap) - view->DragMessage(mDragMessage, dragRect, view); - - StartDragSession(); - view->UnlockLooper(); - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// nsIDragService : StartDragSession -// -// We overwrite this so we can log it -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::StartDragSession() -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::StartDragSession()")); - return nsBaseDragService::StartDragSession(); -} - -//------------------------------------------------------------------------- -// -// nsIDragService : EndDragSession -// -// We overwrite this so we can log it -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::EndDragSession(PRBool aDoneDrag) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::EndDragSession()")); - //Don't reset drag info, keep it until there is a new drag, in case a negotiated drag'n'drop wants the info. - //We need the draginfo as we are ending starting the dragsession - //on entering/exiting different views (nsWindows) now. - //That way the dragsession is always ended when we go outside mozilla windows, but we do throw away the - // mSourceDocument and mSourceNode. We do hold on to the nsTransferable if it was a internal drag. - //ResetDragInfo(); - return nsBaseDragService::EndDragSession(aDoneDrag); -} - -//------------------------------------------------------------------------- -// -// nsIDragSession : SetCanDrop -// -// We overwrite this so we can log it -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::SetCanDrop(PRBool aCanDrop) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop(%s)", - aCanDrop ? "TRUE" : "FALSE")); - return nsBaseDragService::SetCanDrop(aCanDrop); -} - - -//------------------------------------------------------------------------- -// -// nsIDragSession : GetCanDrop -// -// We overwrite this so we can log it -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::GetCanDrop(PRBool *aCanDrop) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetCanDrop()")); - return nsBaseDragService::GetCanDrop(aCanDrop); -} - -//------------------------------------------------------------------------- -// -// nsIDragSession : GetNumDropItems -// -// Gets the number of items currently being dragged -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::GetNumDropItems(PRUint32 * aNumItems) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems()")); - if (nsnull == mDragMessage) - { - *aNumItems = 0; - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems(): WARNING! No dragmessage")); - return NS_OK; - } - // Did we start this drag? - if (IsInternalDrag(mDragMessage)) - mSourceDataItems->Count(aNumItems); - else - // The only thing native that I can think of that may have multiple items - // would be file references, DND-docs don't say anything about multiple items. - *aNumItems = 1; - - - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems():%d", *aNumItems)); - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// nsIDragSession : GetData -// -// Copies the data at the given index into the given nsITransferable -// -// This is usually called on Drop, but can be called before that -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::GetData(nsITransferable * aTransferable, PRUint32 aItemIndex) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetData %d", aItemIndex)); - - if (nsnull==mDragMessage) - return NS_ERROR_INVALID_ARG; - - // get flavor list that includes all acceptable flavors (including - // ones obtained through conversion). Flavors are nsISupportsStrings - // so that they can be seen from JS. - nsresult rv = NS_ERROR_FAILURE; - nsCOMPtr flavorList; - rv = aTransferable->FlavorsTransferableCanImport(getter_AddRefs(flavorList)); - if (NS_FAILED(rv)) - return rv; - - // count the number of flavors - PRUint32 cnt; - flavorList->Count (&cnt); - - nsCOMPtr genericWrapper; - nsCOMPtr currentFlavor; - nsXPIDLCString flavorStr; - nsCOMPtr genericItem; - nsCOMPtr data; - PRUint32 tmpDataLen = 0; - for (unsigned int i= 0; i < cnt; ++i ) - { - flavorList->GetElementAt(i, getter_AddRefs(genericWrapper)); - currentFlavor = do_QueryInterface(genericWrapper); - if (!currentFlavor) - continue; - currentFlavor->ToString(getter_Copies(flavorStr)); - - PR_LOG(sDragLm, PR_LOG_DEBUG, ("tnsDragService::GetData trying to get transfer data for %s", - (const char *)flavorStr)); - - if (IsInternalDrag(mDragMessage)) - { - mSourceDataItems->GetElementAt(aItemIndex, getter_AddRefs(genericItem)); - nsCOMPtr item (do_QueryInterface(genericItem)); - if (!item) - continue; - rv = item->GetTransferData(flavorStr, getter_AddRefs(data), &tmpDataLen); - if (NS_FAILED(rv)) - continue; - PR_LOG(sDragLm, PR_LOG_DEBUG, ("tnsDragService::GetData setting data.")); - return aTransferable->SetTransferData(flavorStr, data, tmpDataLen); - } - else - { - //Check if transfer message is simple_data or older type of DND - //Check if message has data else continue - //Negotiate for data (if possible) or get data - //set and return - } - } - PR_LOG(sDragLm, PR_LOG_DEBUG, ("tnsDragService::GetData failed")); - return NS_ERROR_FAILURE; -} - - -//------------------------------------------------------------------------- -// -// nsIDragSession : IsDataFlavorSupported -// -// Tells whether the given flavor is supported by the current drag object -// -// Called on MouseOver events -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::IsDataFlavorSupported (const char *aDataFlavor, - PRBool *_retval) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported %s", aDataFlavor)); - if (!_retval) - return NS_ERROR_INVALID_ARG; - - // set this to no by default - *_retval = PR_FALSE; - - // check to make sure that we have a drag object set, here - if (nsnull == mDragMessage) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: IsDataFlavorSupported called without a valid drag context!")); - return NS_OK; - } - - if (IsInternalDrag(mDragMessage)) - { - PRUint32 numDragItems = 0; - // if we don't have mDataItems we didn't start this drag so it's - // an external client trying to fool us. - if (nsnull == mSourceDataItems) - return NS_OK; - mSourceDataItems->Count(&numDragItems); - if (0 == numDragItems) - PR_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: Number of dragged items is zero!")); - - // For all dragged items compare their flavors to the one wanted. If there is a match DataFlavor is supported. - nsCOMPtr genericItem; - nsCOMPtr flavorList; - PRUint32 numFlavors; - for (PRUint32 itemIndex = 0; itemIndex < numDragItems; ++itemIndex) - { - mSourceDataItems->GetElementAt(itemIndex, getter_AddRefs(genericItem)); - nsCOMPtr currItem (do_QueryInterface(genericItem)); - if (nsnull == currItem) - continue; - currItem->FlavorsTransferableCanExport(getter_AddRefs(flavorList)); - if (nsnull == flavorList) - continue; - flavorList->Count( &numFlavors ); - - nsCOMPtr genericWrapper; - nsXPIDLCString flavorStr; - for ( PRUint32 flavorIndex = 0; flavorIndex < numFlavors ; ++flavorIndex ) - { - flavorList->GetElementAt (flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr currentFlavor = do_QueryInterface(genericWrapper); - if (nsnull == currentFlavor) - continue; - currentFlavor->ToString ( getter_Copies(flavorStr) ); - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported checking %s against %s", (const char *)flavorStr, aDataFlavor)); - if (0 != strcmp(flavorStr, aDataFlavor)) - continue; - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported Got the flavor!")); - *_retval = PR_TRUE; - return NS_OK; - } - } - } - else - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: Native drag not implemented.")); - // TODO: implement native checking - } - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported FALSE")); - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// nsDragServoce : CreateDragMessage -// -// Builds the drag message needed for BeOS negotiated DND. -// -//------------------------------------------------------------------------- -BMessage * -nsDragService::CreateDragMessage() -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetInitialDragMessage")); - if (nsnull == mSourceDataItems) - return NULL; - - unsigned int numDragItems = 0; - mSourceDataItems->Count(&numDragItems); - - BMessage * returnMsg = new BMessage(B_SIMPLE_DATA); - - returnMsg->AddString("be:originator", "BeZilla"); - returnMsg->AddString("be:clip_name","BeZilla Drag Item"); - - if (mDragAction & DRAGDROP_ACTION_COPY) - returnMsg->AddInt32("be:actions",B_COPY_TARGET); - if (mDragAction & DRAGDROP_ACTION_MOVE) - returnMsg->AddInt32("be:actions",B_MOVE_TARGET); - if (mDragAction & DRAGDROP_ACTION_LINK) - returnMsg->AddInt32("be:actions",B_LINK_TARGET); - - // Check to see if we're dragging > 1 item. If we are then we use - // an internal only type. - if (numDragItems > 1) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService:: Dragging a list of items ...")); -// returnMsg->AddString("be:types", gMimeListType); -// returnMsg->AddString("be:types", B_FILE_MIME_TYPE); -// returnMsg->AddString("be:filetypes", gMimeListType); -// returnMsg->AddString("be:type_descriptions", gMimeListType); - return returnMsg; - } - - PRBool addedType = PR_FALSE; - - nsCOMPtr genericItem; - nsCOMPtr flavorList; - PRUint32 numFlavors; - nsCOMPtr genericWrapper; - nsXPIDLCString flavorStr; - - for (unsigned int itemIndex = 0; itemIndex < numDragItems; ++itemIndex) - { - mSourceDataItems->GetElementAt(itemIndex, getter_AddRefs(genericItem)); - nsCOMPtr currItem (do_QueryInterface(genericItem)); - if (nsnull == currItem) - continue; - - currItem->FlavorsTransferableCanExport(getter_AddRefs(flavorList)); - if (nsnull == flavorList) - continue; - flavorList->Count( &numFlavors ); - for (PRUint32 flavorIndex = 0; flavorIndex < numFlavors ; ++flavorIndex ) - { - flavorList->GetElementAt(flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr currentFlavor = do_QueryInterface(genericWrapper); - if (nsnull == currentFlavor) - continue; - currentFlavor->ToString ( getter_Copies(flavorStr) ); - - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService:: Adding a flavor to our message: %s",flavorStr.get())); - - type_code aCode; - if (B_OK == returnMsg->GetInfo(flavorStr.get(), &aCode)) - continue; - returnMsg->AddString("be:types",flavorStr.get()); - - //returnMsg->AddString("be:types", B_FILE_MIME_TYPE); - returnMsg->AddString("be:filetypes",flavorStr.get()); - returnMsg->AddString("be:type_descriptions",flavorStr.get()); - - addedType = PR_TRUE; - // Check to see if this is text/unicode. If it is, add - // text/plain since we automatically support text/plain if - // we support text/unicode. - //tqh: but this may cause duplicates? - if (0 == strcmp(flavorStr, kUnicodeMime)) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService:: Adding a TextMime for the UnicodeMime")); - returnMsg->AddString("be:types",kTextMime); - //returnMsg->AddString("be:types", B_FILE_MIME_TYPE); - returnMsg->AddString("be:filetypes",kTextMime); - returnMsg->AddString("be:type_descriptions",kTextMime); - } - } - } - - if (addedType) - { - returnMsg->AddString("be:types", B_FILE_MIME_TYPE); - } - returnMsg->PrintToStream(); - // If we did not add a type, we can't drag - NS_ASSERTION(addedType, "No flavor/mime in the drag message!"); - return returnMsg; -} - -//------------------------------------------------------------------------- -// -// nsIDragSessionBeOS : UpdateDragMessageIfNeeded -// -// Updates the drag message from the old one if we enter a mozilla view with -// a dragmessage from outside. IE one where "be:originator"-key != "BeZilla" -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::UpdateDragMessageIfNeeded(BMessage *aDragMessage) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::UpdateDragMessageIfNeeded()")); - if (aDragMessage == mDragMessage) - return NS_OK; - - // Did we start this drag? - //It's already set properly by InvokeDragSession, so don't do anything and avoid throwing away - //mSourceDataItems - if (IsInternalDrag(aDragMessage)) - return NS_OK; - - PR_LOG(sDragLm, PR_LOG_DEBUG, ("updating.")); - ResetDragInfo(); - mDragMessage = aDragMessage; - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// nsIDragSessionBeOS : TransmitData -// -// When a negotiated drag'n'drop to another app occurs nsWindow -// calls this method with the other apps message which contains -// the info on what data the app wants. This function checks the -// message and transmits the data to the app, thereby ending the -// drag'n'drop to another app. -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsDragService::TransmitData(BMessage *aNegotiationReply) -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TransmitData()")); -/* - unsigned int numDragItems = 0; - mSourceDataItems->Count(&numDragItems); - - returnMsg->AddString("be:originator", "BeZilla"); - returnMsg->AddString("be:clip_name","BeZilla Drag Item"); - - // Check to see if we're dragging > 1 item. If we are then we use - // an internal only type. - if (numDragItems > 1) - { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService:: Dragging a list of items ...")); - delete aNegotiationReply; - return; - } - BMessage aReply = new BMessage(B_MIME_DATA); - char * aMimeType; - aNegotiationReply->FindString("be:types", &aMimeType); - nsCOMPtr item; - item->addDataFlavor(aMimeType); - GetData(item, 0); - aReply->AddData(aMimeType, item->); - */ - aNegotiationReply->PrintToStream(); - delete aNegotiationReply; - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// nsIDragService : ResetDragInfo -// -// Resets the stored drag information. -// -//------------------------------------------------------------------------- -void -nsDragService::ResetDragInfo() -{ - PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::ResetDragInfo()")); - if (nsnull != mDragMessage) delete mDragMessage; - mDragMessage = NULL; - mSourceDataItems = NULL; -} - -const char * -nsDragService::FlavorToBeMime(const char * flavor) -{ - //text/plain ok - //text/unicode -> text/plain - if (0 == strcmp(flavor,kUnicodeMime)) return kTextMime; - //text/html ok - //AOLMAIL ignore!! - //image/png ok - //image/jpg - if (0 == strcmp(flavor,kJPEGImageMime)) return "image/jpeg"; - //image/gif ok - //application/x-moz-file - if (0 == strcmp(flavor,kFileMime)) return "application/octet-stream"; - //text/x-moz-url (only support this as a filetype (Be bookmark)) - if (0 == strcmp(flavor,kURLMime)) return "application/x-vnd.Be-bookmark"; - //text/x-moz-url-data - we need to read data to find out what type of URL. - //text/x-moz-url-desc - a url-description (same as title?) - //kNativeImageMime - don't support as BeOS image - //kNativeHTMLMime - don't support on BeOS side - //kFilePromiseURLMime - //kFilePromiseDestFilename - //kFilePromiseMime - //kFilePromiseDirectoryMime - -// if (0==strcmp(flavor,kUnicodeMime)) -} diff --git a/widget/src/beos/nsDragService.h b/widget/src/beos/nsDragService.h deleted file mode 100644 index 3b0c2b497ffa..000000000000 --- a/widget/src/beos/nsDragService.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fredrik Holmqvist - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsDragService_h__ -#define nsDragService_h__ - -#include "nsBaseDragService.h" -#include "nsIDragSessionBeOS.h" -#include - -class BMessage; - -/** - * Native BeOS DragService wrapper - */ -class nsDragService : public nsBaseDragService, public nsIDragSessionBeOS -{ - -public: - nsDragService(); - virtual ~nsDragService(); - - //nsISupports - NS_DECL_ISUPPORTS_INHERITED - - //nsIDragService - NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode, - nsISupportsArray * anArrayTransferables, - nsIScriptableRegion * aRegion, - PRUint32 aActionType); - NS_IMETHOD StartDragSession(); - NS_IMETHOD EndDragSession(PRBool aDoneDrag); - - // nsIDragSession - NS_IMETHOD GetNumDropItems (PRUint32 * aNumItems); - NS_IMETHOD GetData (nsITransferable * aTransferable, - PRUint32 aItemIndex); - NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, - PRBool *_retval); - - NS_IMETHOD GetCanDrop(PRBool * aCanDrop); - NS_IMETHOD SetCanDrop(PRBool aCanDrop); - - // nsIDragSessionBeOS - NS_IMETHOD UpdateDragMessageIfNeeded(BMessage *aDragMessage); - NS_IMETHOD TransmitData(BMessage *aNegotiationReply); - - -protected: - nsCOMPtr mSourceDataItems; - -private: - // BeOS specific methods - void ResetDragInfo(void); - - BMessage *mDragMessage; - - //If we want to do image-dragging - //BBitmap *dragBitmap; - - // internal drag identifier for lists - BString gMimeListType; - PRPackedBool IsDragList(void); - PRPackedBool mDragIsList; - - // get the initial drag message for this drag - BMessage * CreateDragMessage(); - static const char * FlavorToBeMime(const char * flavor); -}; - -#endif // nsDragService_h__ diff --git a/widget/src/beos/nsFilePicker.cpp b/widget/src/beos/nsFilePicker.cpp deleted file mode 100644 index fd9bea5a5301..000000000000 --- a/widget/src/beos/nsFilePicker.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Makoto Hamanaka - * Paul Ashford - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsCOMPtr.h" -#include "nsNetUtil.h" -#include "nsIServiceManager.h" -#include "nsIPlatformCharset.h" -#include "nsFilePicker.h" -#include "nsILocalFile.h" -#include "nsIURL.h" -#include "nsIStringBundle.h" -#include "nsReadableUtils.h" -#include "nsEscape.h" -#include "nsEnumeratorUtils.h" -#include "nsString.h" -#include -#include -#include - -NS_IMPL_THREADSAFE_ISUPPORTS1(nsFilePicker, nsIFilePicker) - -#ifdef FILEPICKER_SAVE_LAST_DIR -char nsFilePicker::mLastUsedDirectory[B_PATH_NAME_LENGTH+1] = { 0 }; -#endif - -//------------------------------------------------------------------------- -// -// nsFilePicker constructor -// -//------------------------------------------------------------------------- -nsFilePicker::nsFilePicker() - : mParentWindow(nsnull) - , mUnicodeEncoder(nsnull) - , mUnicodeDecoder(nsnull) -{ -} - -//------------------------------------------------------------------------- -// -// nsFilePicker destructor -// -//------------------------------------------------------------------------- -nsFilePicker::~nsFilePicker() -{ - NS_IF_RELEASE(mUnicodeEncoder); - NS_IF_RELEASE(mUnicodeDecoder); -} - -//------------------------------------------------------------------------- -// -// Show - Display the file dialog -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval) -{ - PRBool result = PR_TRUE; - nsFilePanelBeOS *ppanel; - file_panel_mode panel_mode; - bool allow_multiple_selection = false; - uint32 node_flavors; - - if (mMode == modeGetFolder) { - node_flavors = B_DIRECTORY_NODE; - panel_mode = B_OPEN_PANEL; - } - else if (mMode == modeOpen) { - node_flavors = B_FILE_NODE; - panel_mode = B_OPEN_PANEL; - } - else if (mMode == modeOpenMultiple) { - node_flavors = B_FILE_NODE; - panel_mode = B_OPEN_PANEL; - allow_multiple_selection = true; - } - else if (mMode == modeSave) { - node_flavors = B_FILE_NODE; - panel_mode = B_SAVE_PANEL; - } - else { - printf("nsFilePicker::Show() wrong mode"); - return PR_FALSE; - } - - ppanel = new nsFilePanelBeOS( - panel_mode, //file_panel_mode mode - node_flavors, //uint32 node_flavors - allow_multiple_selection, //bool allow_multiple_selection - false, //bool modal - true //bool hide_when_done - ); - if (!ppanel) return PR_FALSE; - - // set title - if (!mTitle.IsEmpty()) { - char *title_utf8 = ToNewUTF8String(mTitle); - ppanel->Window()->SetTitle(title_utf8); - Recycle(title_utf8); - } - - // set default text - if (!mDefault.IsEmpty()) { - char *defaultText = ToNewUTF8String(mDefault); - ppanel->SetSaveText(defaultText); - Recycle(defaultText); - } - - // set initial directory - nsCAutoString initialDir; - if (mDisplayDirectory) - mDisplayDirectory->GetNativePath(initialDir); - if(initialDir.IsEmpty()) { -#ifdef FILEPICKER_SAVE_LAST_DIR - if (strlen(mLastUsedDirectory) < 2) - initialDir.Assign("/boot/home"); - else - initialDir.Assign(mLastUsedDirectory); -#else - ppanel->SetPanelDirectory(initialDir.get()); -#endif - } - -#ifdef FILEPICKER_SAVE_LAST_DIR - ppanel->SetPanelDirectory(initialDir.get()); -#endif - - // set modal feel - if (ppanel->LockLooper()) { - ppanel->Window()->SetFeel(B_MODAL_APP_WINDOW_FEEL); - ppanel->UnlockLooper(); - } - - // Show File Panel - ppanel->Show(); - ppanel->WaitForSelection(); - - if (ppanel->IsCancelSelected()) { - result = PR_FALSE; - } - - if ((mMode == modeOpen || mMode == modeOpenMultiple || mMode == modeGetFolder) && ppanel->IsOpenSelected()) { - BList *list = ppanel->OpenRefs(); - uint32 numfiles = list->CountItems(); - if ((list) && numfiles >= 1) { - nsresult rv; - for (uint32 i = 0; i< numfiles; i++) { - BPath *path = (BPath *)list->ItemAt(i); - - if (path->InitCheck() == B_OK) { - mFile.Truncate(); - // Single and Multiple are exclusive now, though, maybe there is sense - // to assign also first list element to mFile even in openMultiple case ? - if (mMode == modeOpenMultiple) { - nsCOMPtr file = do_CreateInstance("@mozilla.org/file/local;1", &rv); - NS_ENSURE_SUCCESS(rv,rv); - rv = file->InitWithNativePath(nsDependentCString(path->Path())); - NS_ENSURE_SUCCESS(rv,rv); - rv = mFiles.AppendObject(file); - NS_ENSURE_SUCCESS(rv,rv); - } else { - if (i == 0) mFile.Assign(path->Path()); - } - } else { - printf("path.init failed \n"); - } - } - } else { - printf("list not init \n"); - } - } - else if (mMode == modeSave && ppanel->IsSaveSelected()) { - BString savefilename = ppanel->SaveFileName(); - entry_ref ref = ppanel->SaveDirRef(); - BPath path(&ref); - if (path.InitCheck() == B_OK) { - path.Append(savefilename.String(), true); - mFile.Assign(path.Path()); - } - } - else { - result = PR_FALSE; - } - - // set current directory to mDisplayDirectory - entry_ref dir_ref; - ppanel->GetPanelDirectory(&dir_ref); - BEntry dir_entry(&dir_ref); - BPath dir_path; - dir_entry.GetPath(&dir_path); - if (!mDisplayDirectory) - mDisplayDirectory = do_CreateInstance("@mozilla.org/file/local;1"); - if (mDisplayDirectory) - mDisplayDirectory->InitWithNativePath(nsDependentCString(dir_path.Path())); - - if (ppanel->Lock()) { - ppanel->Quit(); - } - - if (result) { - PRInt16 returnOKorReplace = returnOK; - -#ifdef FILEPICKER_SAVE_LAST_DIR - strncpy(mLastUsedDirectory, dir_path.Path(), B_PATH_NAME_LENGTH+1); - if (mDisplayDirectory) - mDisplayDirectory->InitWithNativePath( nsDependentCString(mLastUsedDirectory) ); -#endif - - if (mMode == modeSave) { - // we must check if file already exists - PRBool exists = PR_FALSE; - nsCOMPtr file(do_CreateInstance("@mozilla.org/file/local;1")); - NS_ENSURE_TRUE(file, NS_ERROR_FAILURE); - - file->InitWithNativePath(mFile); - file->Exists(&exists); - if (exists) - returnOKorReplace = returnReplace; - } - *retval = returnOKorReplace; - } - else { - *retval = returnCancel; - } - return NS_OK; - - // TODO: implement filters -} - - - -NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile **aFile) -{ - NS_ENSURE_ARG_POINTER(aFile); - - if (mFile.IsEmpty()) - return NS_OK; - - nsCOMPtr file(do_CreateInstance("@mozilla.org/file/local;1")); - - NS_ENSURE_TRUE(file, NS_ERROR_FAILURE); - - file->InitWithNativePath(mFile); - - NS_ADDREF(*aFile = file); - - return NS_OK; -} - -NS_IMETHODIMP nsFilePicker::GetFiles(nsISimpleEnumerator **aFiles) -{ - NS_ENSURE_ARG_POINTER(aFiles); - return NS_NewArrayEnumerator(aFiles, mFiles); -} - -//------------------------------------------------------------------------- - -NS_IMETHODIMP nsFilePicker::GetFileURL(nsIURI **aFileURL) -{ - *aFileURL = nsnull; - nsCOMPtr file; - nsresult rv = GetFile(getter_AddRefs(file)); - if (!file) - return rv; - - return NS_NewFileURI(aFileURL, file); -} - -//------------------------------------------------------------------------- -// -// Get the file + path -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsFilePicker::SetDefaultString(const nsAString& aString) -{ - mDefault = aString; - return NS_OK; -} - -NS_IMETHODIMP nsFilePicker::GetDefaultString(nsAString& aString) -{ - return NS_ERROR_FAILURE; -} - -//------------------------------------------------------------------------- -// -// The default extension to use for files -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsFilePicker::GetDefaultExtension(nsAString& aExtension) -{ - aExtension.Truncate(); - return NS_OK; -} - -NS_IMETHODIMP nsFilePicker::SetDefaultExtension(const nsAString& aExtension) -{ - return NS_OK; -} - -//------------------------------------------------------------------------- -void nsFilePicker::InitNative(nsIWidget *aParent, - const nsAString& aTitle, - PRInt16 aMode) -{ - mParentWindow = 0; - - BView *view = (BView *) aParent->GetNativeData(NS_NATIVE_WIDGET); - if (view && view->LockLooper()) { - mParentWindow = view->Window(); - view->UnlockLooper(); - } - - mTitle.Assign(aTitle); - mMode = aMode; -} - -NS_IMETHODIMP -nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) -{ - mFilterList.Append(aTitle); - mFilterList.Append(PRUnichar('\0')); - mFilterList.Append(aFilter); - mFilterList.Append(PRUnichar('\0')); - - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// BeOS native File Panel -// -//------------------------------------------------------------------------- - -// Internal message for when the 'Select ' button is used -const uint32 MSG_DIRECTORY = 'mDIR'; - -nsFilePanelBeOS::nsFilePanelBeOS(file_panel_mode mode, - uint32 node_flavors, - bool allow_multiple_selection, - bool modal, - bool hide_when_done) - : BLooper() - , BFilePanel(mode, - NULL, NULL, - node_flavors, - allow_multiple_selection, - NULL, NULL, - modal, - hide_when_done) - , mSelectedActivity(nsFilePanelBeOS::NOT_SELECTED) - , mIsSelected(false) - , mSaveFileName("") - , mSaveDirRef() - , mOpenRefs() -{ - if ((wait_sem = create_sem(1,"FilePanel")) < B_OK) - printf("nsFilePanelBeOS::nsFilePanelBeOS : create_sem error\n"); - if (wait_sem > 0) acquire_sem(wait_sem); - - SetTarget(BMessenger(this)); - - if ( mode == B_OPEN_PANEL && node_flavors == B_DIRECTORY_NODE ) - { - // Add a 'Select ' button to the open dialog - Window()->Lock(); - - BView *background = Window()->ChildAt(0); - entry_ref ref; - char label[10+B_FILE_NAME_LENGTH]; - GetPanelDirectory(&ref); - sprintf(label, "Select '%s'", ref.name); - mDirectoryButton = new BButton( - BRect(113, background->Bounds().bottom-35, 269, background->Bounds().bottom-10), - "directoryButton", label, new BMessage(MSG_DIRECTORY), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); - - if(mDirectoryButton) - { - background->AddChild(mDirectoryButton); - mDirectoryButton->SetTarget(Messenger()); - } - else - NS_ASSERTION(false, "Out of memory: failed to create mDirectoryButton"); - - SetButtonLabel(B_DEFAULT_BUTTON, "Select"); - - Window()->Unlock(); - } - else - mDirectoryButton = nsnull; - - this->Run(); -} - -nsFilePanelBeOS::~nsFilePanelBeOS() -{ - int count = mOpenRefs.CountItems(); - for (int i=0 ; i 0) { - delete_sem(wait_sem); - } -} - -void nsFilePanelBeOS::MessageReceived(BMessage *msg) -{ - switch ( msg->what ) { - case B_REFS_RECEIVED: // open - int32 count; - type_code code; - msg->GetInfo("refs", &code, &count); - if (code == B_REF_TYPE) { - for (int i=0 ; iFindRef("refs", i, &ref) == B_OK) { - BPath *path = new BPath(&ref); - mOpenRefs.AddItem((void *) path); - } - } - } else { - printf("nsFilePanelBeOS::MessageReceived() no ref!\n"); - } - mSelectedActivity = OPEN_SELECTED; - mIsSelected = true; - release_sem(wait_sem); - break; - - case MSG_DIRECTORY: // Directory selected - { - entry_ref ref; - GetPanelDirectory(&ref); - BPath *path = new BPath(&ref); - mOpenRefs.AddItem((void *) path); - mSelectedActivity = OPEN_SELECTED; - mIsSelected = true; - release_sem(wait_sem); - break; - } - - case B_SAVE_REQUESTED: // save - msg->FindString("name", &mSaveFileName); - msg->FindRef("directory", &mSaveDirRef); - mSelectedActivity = SAVE_SELECTED; - mIsSelected = true; - release_sem(wait_sem); - break; - - case B_CANCEL: // cancel - if (mIsSelected) break; - mSelectedActivity = CANCEL_SELECTED; - mIsSelected = true; - release_sem(wait_sem); - break; - default: - break; - } -} - -void nsFilePanelBeOS::WaitForSelection() -{ - if (wait_sem > 0) { - acquire_sem(wait_sem); - release_sem(wait_sem); - } -} - -uint32 nsFilePanelBeOS::SelectedActivity() -{ - uint32 result = 0; - result = mSelectedActivity; - - return result; -} - -void nsFilePanelBeOS::SelectionChanged(void) -{ - if(mDirectoryButton) - { - //Update the 'Select ' button - entry_ref ref; - char label[50]; - GetPanelDirectory(&ref); - Window()->Lock(); - sprintf(label, "Select '%s'", ref.name); - mDirectoryButton->SetLabel(label); - Window()->Unlock(); - } - BFilePanel::SelectionChanged(); -} - diff --git a/widget/src/beos/nsFilePicker.h b/widget/src/beos/nsFilePicker.h deleted file mode 100644 index 71f3423c7490..000000000000 --- a/widget/src/beos/nsFilePicker.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Makoto Hamanaka - * Paul Ashford - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsFilePicker_h__ -#define nsFilePicker_h__ - -#ifndef DEBUG -// XXX adding mLastUsedDirectory and code for handling last used folder on File Open/Save -// caused crashes in DEBUG builds on some machines - see comments for bug 177720 -// works well on "normal" builds -#define FILEPICKER_SAVE_LAST_DIR 1 -#endif - -#include "nsICharsetConverterManager.h" -#include "nsBaseFilePicker.h" -#include "nsString.h" -#include "nsdefs.h" -#include "nsIFileChannel.h" -#include "nsILocalFile.h" -#include "nsISimpleEnumerator.h" -#include "nsCOMArray.h" - -// -// Native BeOS FileSelector wrapper -// - -#include -#include -#include -#include -class BButton; - -class nsFilePicker : public nsBaseFilePicker -{ -public: - NS_DECL_ISUPPORTS - - nsFilePicker(); - virtual ~nsFilePicker(); - - // nsIFilePicker (less what's in nsBaseFilePicker) - NS_IMETHOD GetDefaultString(nsAString& aDefaultString); - NS_IMETHOD SetDefaultString(const nsAString& aDefaultString); - NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension); - NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension); - NS_IMETHOD GetFile(nsILocalFile * *aFile); - NS_IMETHOD GetFileURL(nsIURI * *aFileURL); - NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles); - NS_IMETHOD Show(PRInt16 *_retval); - NS_IMETHOD AppendFilter(const nsAString& aTitle, const nsAString& aFilter); - -protected: - // method from nsBaseFilePicker - virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle, - PRInt16 aMode); - - - void GetFilterListArray(nsString& aFilterList); - - BWindow* mParentWindow; - nsString mTitle; - PRInt16 mMode; - nsCString mFile; - nsString mDefault; - nsString mFilterList; - nsIUnicodeEncoder* mUnicodeEncoder; - nsIUnicodeDecoder* mUnicodeDecoder; - PRInt16 mSelectedType; - nsCOMArray mFiles; - -#ifdef FILEPICKER_SAVE_LAST_DIR - static char mLastUsedDirectory[]; -#endif -}; - -class nsFilePanelBeOS : public BLooper, public BFilePanel -{ -public: - nsFilePanelBeOS(file_panel_mode mode, - uint32 node_flavors, - bool allow_multiple_selection, - bool modal, - bool hide_when_done); - virtual ~nsFilePanelBeOS(); - - virtual void MessageReceived(BMessage *message); - virtual void WaitForSelection(); - - virtual void SelectionChanged(); - - virtual bool IsOpenSelected() { - return (SelectedActivity() == OPEN_SELECTED); - } - virtual bool IsSaveSelected() { - return (SelectedActivity() == SAVE_SELECTED); - } - virtual bool IsCancelSelected() { - return (SelectedActivity() == CANCEL_SELECTED); - } - virtual uint32 SelectedActivity(); - - virtual BList *OpenRefs() { return &mOpenRefs; } - virtual BString SaveFileName() { return mSaveFileName; } - virtual entry_ref SaveDirRef() { return mSaveDirRef; } - - enum { - NOT_SELECTED = 0, - OPEN_SELECTED = 1, - SAVE_SELECTED = 2, - CANCEL_SELECTED = 3 - }; - -protected: - BButton *mDirectoryButton; - sem_id wait_sem ; - uint32 mSelectedActivity; - bool mIsSelected; - BString mSaveFileName; - entry_ref mSaveDirRef; - BList mOpenRefs; -}; - -#endif // nsFilePicker_h__ diff --git a/widget/src/beos/nsLookAndFeel.cpp b/widget/src/beos/nsLookAndFeel.cpp deleted file mode 100644 index df02f82cd637..000000000000 --- a/widget/src/beos/nsLookAndFeel.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsLookAndFeel.h" -#include "nsFont.h" -#include "nsSize.h" - -#include -#include - -nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel() -{ -} - -nsLookAndFeel::~nsLookAndFeel() -{ -} - -nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) -{ - nsresult res = NS_OK; - rgb_color color; - /* - * There used to be an entirely separate list of these colors in - * nsDeviceContextBeOS::GetSystemAttribute. The colors given there - * were a bit different from these. If these are inaccurate, it might - * be worth looking at cvs history for the ones there to see if they - * were better. - */ - - switch (aID) { - case eColor_WindowBackground: - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - case eColor_WindowForeground: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_WidgetBackground: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case eColor_WidgetForeground: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_WidgetSelectBackground: - { - color = ui_color(B_MENU_SELECTION_BACKGROUND_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_WidgetSelectForeground: - aColor = NS_RGB(0x00, 0x00, 0x80); - break; - case eColor_Widget3DHighlight: - aColor = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case eColor_Widget3DShadow: - aColor = NS_RGB(0x40, 0x40, 0x40); - break; - case eColor_TextBackground: - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - case eColor_TextForeground: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_TextSelectBackground: - case eColor_IMESelectedRawTextBackground: - case eColor_IMESelectedConvertedTextBackground: - { - // looks good in Mozilla, though, never noticed this color in BeOS menu - color = ui_color(B_MENU_SELECTION_BACKGROUND_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_TextSelectForeground: - case eColor_IMESelectedRawTextForeground: - case eColor_IMESelectedConvertedTextForeground: - { - color = ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_IMERawInputBackground: - case eColor_IMEConvertedTextBackground: - aColor = NS_TRANSPARENT; - break; - case eColor_IMERawInputForeground: - case eColor_IMEConvertedTextForeground: - aColor = NS_SAME_AS_FOREGROUND_COLOR; - break; - case eColor_IMERawInputUnderline: - case eColor_IMEConvertedTextUnderline: - aColor = NS_SAME_AS_FOREGROUND_COLOR; - break; - case eColor_IMESelectedRawTextUnderline: - case eColor_IMESelectedConvertedTextUnderline: - aColor = NS_TRANSPARENT; - break; - case eColor_SpellCheckerUnderline: - aColor = NS_RGB(0xff, 0, 0); - break; - // two following colors get initialisation in XPLookAndFeel. - //eColor_TextSelectBackgroundDisabled, - //eColor_TextSelectBackgroundAttention, - - // CSS 2 Colors - case eColor_activeborder: - aColor = NS_RGB(0x88, 0x88, 0x88); - break; - // active titletab - case eColor_activecaption: - { - color = ui_color(B_WINDOW_TAB_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - //MDI color - case eColor_appworkspace: - aColor = NS_RGB(0xd8, 0xd8, 0xd8); - break; - //incidentally, this is supposed to be the colour of the desktop, though how anyone - //is supposed to guess that from the name? - case eColor_background: - { - color = ui_color(B_DESKTOP_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_buttonface: - case eColor__moz_buttonhoverface: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - //should be lighter of 2 possible highlight colours available - case eColor_buttonhighlight: - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - //darker of 2 possible shadow colours available - case eColor_buttonshadow: - aColor = NS_RGB(0x77, 0x77, 0x77); - break; - case eColor_buttontext: - case eColor__moz_buttonhovertext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_captiontext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_graytext: - aColor = NS_RGB(0x77, 0x77, 0x77); - break; - case eColor_highlight: - case eColor__moz_html_cellhighlight: - case eColor__moz_menuhover: - { - // B_MENU_SELECTION_BACKGROUND_COLOR is used for text selection - // this blue colors seems more suitable - color = ui_color(B_KEYBOARD_NAVIGATION_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_highlighttext: - case eColor__moz_html_cellhighlighttext: - case eColor__moz_menuhovertext: - { - color = ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_inactiveborder: - aColor = NS_RGB(0x55, 0x55, 0x55); - break; - case eColor_inactivecaption: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case eColor_inactivecaptiontext: - aColor = NS_RGB(0x77, 0x77, 0x77); - break; - case eColor_infobackground: - // tooltips - aColor = NS_RGB(0xff, 0xff, 0xd0); - break; - case eColor_infotext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor_menu: - { - color = ui_color(B_MENU_BACKGROUND_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_menutext: - case eColor__moz_menubartext: - { - color = ui_color(B_MENU_ITEM_TEXT_COLOR); - aColor = NS_RGB(color.red, color.green, color.blue); - } - break; - case eColor_scrollbar: - aColor = NS_RGB(0xaa, 0xaa, 0xaa); - break; - case eColor_threeddarkshadow: - aColor = NS_RGB(0x77, 0x77, 0x77); - break; - case eColor_threedface: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case eColor_threedhighlight: - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - case eColor_threedlightshadow: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case eColor_threedshadow: - aColor = NS_RGB(0x99, 0x99, 0x99); - break; - case eColor_window: - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - case eColor_windowframe: - aColor = NS_RGB(0xcc, 0xcc, 0xcc); - break; - case eColor_windowtext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor__moz_eventreerow: - case eColor__moz_oddtreerow: - case eColor__moz_field: - case eColor__moz_combobox: - // normal widget background - aColor = NS_RGB(0xff, 0xff, 0xff); - break; - case eColor__moz_fieldtext: - case eColor__moz_comboboxtext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor__moz_dialog: - case eColor__moz_cellhighlight: - //all bars including MenuBar - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case eColor__moz_dialogtext: - case eColor__moz_cellhighlighttext: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case eColor__moz_dragtargetzone: - aColor = NS_RGB(0x63, 0x63, 0xCE); - break; - case eColor__moz_buttondefault: - aColor = NS_RGB(0x77, 0x77, 0x77); - break; - case eColor_LAST_COLOR: - default: - aColor = NS_RGB(0xff, 0xff, 0xff); - res = NS_ERROR_FAILURE; - break; - } - - return res; -} - -NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) -{ - nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric); - if (NS_SUCCEEDED(res)) - return res; - res = NS_OK; - - /* - * There used to be an entirely separate list of these metrics in - * nsDeviceContextBeOS::GetSystemAttribute. The metrics given there - * were a bit different from these. If these are inaccurate, it might - * be worth looking at cvs history for the ones there to see if they - * were better. - */ - - switch (aID) - { - case eMetric_CaretBlinkTime: - aMetric = 500; - break; - case eMetric_CaretWidth: - aMetric = 1; - break; - case eMetric_ShowCaretDuringSelection: - aMetric = 1; - break; - case eMetric_SelectTextfieldsOnKeyFocus: - // Do not select textfield content when focused by kbd - // used by nsEventStateManager::sTextfieldSelectModel - aMetric = 0; - break; - case eMetric_SubmenuDelay: - aMetric = 500; - break; - case eMetric_MenusCanOverlapOSBar: // can popups overlap menu/task bar? - aMetric = 0; - break; - case eMetric_ScrollArrowStyle: - { - aMetric = eMetric_ScrollArrowStyleBothAtEachEnd; // BeOS default - - scroll_bar_info info; - if(B_OK == get_scroll_bar_info(&info) && !info.double_arrows) - { - aMetric = eMetric_ScrollArrowStyleSingle; - } - } - break; - case eMetric_ScrollSliderStyle: - { - aMetric = eMetric_ScrollThumbStyleProportional; // BeOS default - - scroll_bar_info info; - if(B_OK == get_scroll_bar_info(&info) && !info.proportional) - { - aMetric = eMetric_ScrollThumbStyleNormal; - } - } - break; - case eMetric_TreeOpenDelay: - aMetric = 1000; - break; - case eMetric_TreeCloseDelay: - aMetric = 1000; - break; - case eMetric_TreeLazyScrollDelay: - aMetric = 150; - break; - case eMetric_TreeScrollDelay: - aMetric = 100; - break; - case eMetric_TreeScrollLinesMax: - aMetric = 3; - break; - case eMetric_DWMCompositor: - case eMetric_WindowsClassic: - case eMetric_WindowsDefaultTheme: - case eMetric_TouchEnabled: - aMetric = 0; - res = NS_ERROR_NOT_IMPLEMENTED; - break; - case eMetric_MacGraphiteTheme: - case eMetric_MaemoClassic: - aMetric = 0; - res = NS_ERROR_NOT_IMPLEMENTED; - break; - case eMetric_IMERawInputUnderlineStyle: - case eMetric_IMEConvertedTextUnderlineStyle: - aMetric = NS_UNDERLINE_STYLE_SOLID; - break; - case eMetric_IMESelectedRawTextUnderlineStyle: - case eMetric_IMESelectedConvertedTextUnderline: - aMetric = NS_UNDERLINE_STYLE_NONE; - break; - case eMetric_SpellCheckerUnderlineStyle: - aMetric = NS_UNDERLINE_STYLE_WAVY; - break; - default: - aMetric = 0; - res = NS_ERROR_FAILURE; - } - return res; -} - -NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric) -{ - nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric); - if (NS_SUCCEEDED(res)) - return res; - res = NS_OK; - - switch (aID) { - case eMetricFloat_IMEUnderlineRelativeSize: - aMetric = 1.0f; - break; - case eMetricFloat_SpellCheckerUnderlineRelativeSize: - aMetric = 1.0f; - break; - default: - aMetric = -1.0; - res = NS_ERROR_FAILURE; - } - return res; -} diff --git a/widget/src/beos/nsLookAndFeel.h b/widget/src/beos/nsLookAndFeel.h deleted file mode 100644 index ba536034c2cd..000000000000 --- a/widget/src/beos/nsLookAndFeel.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef __nsLookAndFeel -#define __nsLookAndFeel -#include "nsXPLookAndFeel.h" - -class nsLookAndFeel: public nsXPLookAndFeel { -public: - nsLookAndFeel(); - virtual ~nsLookAndFeel(); - - nsresult NativeGetColor(const nsColorID aID, nscolor &aColor); - NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric); - NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric); -}; - -#endif diff --git a/widget/src/beos/nsPopupWindow.cpp b/widget/src/beos/nsPopupWindow.cpp deleted file mode 100644 index 0f7869b6a0b3..000000000000 --- a/widget/src/beos/nsPopupWindow.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla Browser. - * - * The Initial Developer of the Original Code is - * Fredrik Holmqvist . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsPopupWindow.h" - -nsPopupWindow::nsPopupWindow() : nsWindow() -{ -} - - -//------------------------------------------------------------------------- -// -// Utility method for implementing both Create(nsIWidget ...) and -// Create(nsNativeWidget...) -//------------------------------------------------------------------------- -nsresult nsPopupWindow::StandardWindowCreate(nsIWidget *aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIAppShell *aAppShell, - nsIToolkit *aToolkit, - nsWidgetInitData *aInitData, - nsNativeWidget aNativeParent) -{ - NS_ASSERTION(aInitData->mWindowType == eWindowType_popup, - "The windowtype is not handled by this class."); - - NS_ASSERTION(!aParent, "Popups should not be hooked into nsIWidget hierarchy"); - - mIsTopWidgetWindow = PR_FALSE; - - BaseCreate(aParent, aRect, aHandleEventFunction, aContext, aAppShell, - aToolkit, aInitData); - - mListenForResizes = aNativeParent ? PR_TRUE : aInitData->mListenForResizes; - - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - nsToolkit* toolkit = (nsToolkit *)mToolkit; - if (toolkit && !toolkit->IsGuiThread()) - { - uint32 args[7]; - args[0] = (uint32)aParent; - args[1] = (uint32)&aRect; - args[2] = (uint32)aHandleEventFunction; - args[3] = (uint32)aContext; - args[4] = (uint32)aAppShell; - args[5] = (uint32)aToolkit; - args[6] = (uint32)aInitData; - - if (nsnull != aParent) - { - // nsIWidget parent dispatch - MethodInfo info(this, this, nsSwitchToUIThread::CREATE, 7, args); - toolkit->CallMethod(&info); - } - else - { - // Native parent dispatch - MethodInfo info(this, this, nsSwitchToUIThread::CREATE_NATIVE, 7, args); - toolkit->CallMethod(&info); - } - return NS_OK; - } - - mParent = aParent; - // Useful shortcut, wondering if we can use it also in GetParent() instead - // nsIWidget* type mParent. - mWindowParent = (nsWindow *)aParent; - SetBounds(aRect); - - // Default mode for window, everything switched off. - // B_AVOID_FOCUS | B_NO_WORKSPACE_ACTIVATION : - // popups always avoid focus and don't force the user to another workspace. - uint32 flags = B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE - | B_NOT_CLOSABLE | B_ASYNCHRONOUS_CONTROLS | B_AVOID_FOCUS - | B_NO_WORKSPACE_ACTIVATION; - window_look look = B_NO_BORDER_WINDOW_LOOK; - - //eBorderStyle_default is to ask the OS to handle it as it sees best. - //eBorderStyle_all is same as top_level window default. - if ( !(eBorderStyle_default == mBorderStyle || eBorderStyle_all & mBorderStyle)) - { - if (eBorderStyle_border & mBorderStyle) - look = B_MODAL_WINDOW_LOOK; - - if (eBorderStyle_resizeh & mBorderStyle) - { - //Resize demands at least border - look = B_MODAL_WINDOW_LOOK; - flags &= !B_NOT_RESIZABLE; - } - - //We don't have titlebar menus, so treat like title as it demands titlebar. - if (eBorderStyle_title & mBorderStyle || eBorderStyle_menu & mBorderStyle) - look = B_TITLED_WINDOW_LOOK; - - if (eBorderStyle_minimize & mBorderStyle) - flags &= !B_NOT_MINIMIZABLE; - - if (eBorderStyle_maximize & mBorderStyle) - flags &= !B_NOT_ZOOMABLE; - - if (eBorderStyle_close & mBorderStyle) - flags &= !B_NOT_CLOSABLE; - } - - if (aNativeParent) - { - // Due poor BeOS capability to control windows hierarchy/z-order we use this - // workaround to show eWindowType_popup (e.g. drop-downs) over floating - // (subset) parent window. - if (((BView *)aNativeParent)->Window() && - ((BView *)aNativeParent)->Window()->IsFloating()) - { - mBWindowFeel = B_FLOATING_ALL_WINDOW_FEEL; - } - } - - - nsWindowBeOS * w = new nsWindowBeOS(this, - BRect(aRect.x, aRect.y, aRect.x + aRect.width - 1, aRect.y + aRect.height - 1), - "", look, mBWindowFeel, flags); - if (!w) - return NS_ERROR_OUT_OF_MEMORY; - - mView = new nsViewBeOS(this, w->Bounds(), "popup view", - B_FOLLOW_ALL, B_WILL_DRAW); - - if (!mView) - return NS_ERROR_OUT_OF_MEMORY; - - w->AddChild(mView); - // Run Looper. No proper destroy without it. - w->Run(); - DispatchStandardEvent(NS_CREATE); - return NS_OK; -} - -NS_METHOD nsPopupWindow::Show(PRBool bState) -{ - //Bring popup to correct workspace. - if (bState && mView && mView->Window() != NULL) - mView->Window()->SetWorkspaces(B_CURRENT_WORKSPACE); - - return nsWindow::Show(bState); -} - - diff --git a/widget/src/beos/nsPopupWindow.h b/widget/src/beos/nsPopupWindow.h deleted file mode 100644 index 15ffe38d33f3..000000000000 --- a/widget/src/beos/nsPopupWindow.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla Browser. - * - * The Initial Developer of the Original Code is - * Fredrik Holmqvist . - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsPopupWindow_h__ -#define nsPopupWindow_h__ - -#include "nsWindow.h" - -class nsPopupWindow : public nsWindow -{ -public: - nsPopupWindow(); - - NS_IMETHOD Show(PRBool bState); - -protected: - virtual nsresult StandardWindowCreate(nsIWidget *aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIAppShell *aAppShell, - nsIToolkit *aToolkit, - nsWidgetInitData *aInitData, - nsNativeWidget aNativeParent = nsnull); - -}; -#endif //nsPopupWindow_h__ diff --git a/widget/src/beos/nsPrintOptionsBeOS.cpp b/widget/src/beos/nsPrintOptionsBeOS.cpp deleted file mode 100644 index 392213846a72..000000000000 --- a/widget/src/beos/nsPrintOptionsBeOS.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Paul Ashford - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nsPrintOptionsBeOS.h" - - - -/** --------------------------------------------------- - * See documentation in nsPrintOptionsWin.h - * @update 6/21/00 dwc - */ -nsPrintOptionsBeOS::nsPrintOptionsBeOS() -{ - -} - -/** --------------------------------------------------- - * See documentation in nsPrintOptionsImpl.h - * @update 6/21/00 dwc - */ -nsPrintOptionsBeOS::~nsPrintOptionsBeOS() -{ -} - diff --git a/widget/src/beos/nsPrintOptionsBeOS.h b/widget/src/beos/nsPrintOptionsBeOS.h deleted file mode 100644 index d64e50285a90..000000000000 --- a/widget/src/beos/nsPrintOptionsBeOS.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Paul Ashford - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsPrintOptionsBeOS_h__ -#define nsPrintOptionsBeOS_h__ - -#include "nsPrintOptionsImpl.h" - - -//***************************************************************************** -//*** nsPrintOptions -//***************************************************************************** -class nsPrintOptionsBeOS : public nsPrintOptions -{ -public: - nsPrintOptionsBeOS(); - virtual ~nsPrintOptionsBeOS(); - - -}; - - - -#endif /* nsPrintOptions_h__ */ diff --git a/widget/src/beos/nsPrintdBeOS.h b/widget/src/beos/nsPrintdBeOS.h deleted file mode 100644 index dff61817d72e..000000000000 --- a/widget/src/beos/nsPrintdBeOS.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* Original Code: Syd Logan (syd@netscape.com) 3/12/99 */ - -#ifndef nsPrintdBeOS_h___ -#define nsPrintdBeOS_h___ - -#include - -PR_BEGIN_EXTERN_C - -/* stolen from nsPostScriptObj.h. needs to be put somewhere else that - both ps and gtk can see easily */ - -#ifndef NS_LEGAL_SIZE -#define NS_LETTER_SIZE 0 -#define NS_LEGAL_SIZE 1 -#define NS_EXECUTIVE_SIZE 2 -#define NS_A4_SIZE 3 -#define NS_A3_SIZE 4 - -#define NS_PORTRAIT 0 -#define NS_LANDSCAPE 1 -#endif - -#ifndef PATH_MAX -#ifdef _POSIX_PATH_MAX -#define PATH_MAX _POSIX_PATH_MAX -#else -#define PATH_MAX 256 -#endif -#endif - -typedef struct beosprdata { - PRBool toPrinter; /* If PR_TRUE, print to printer */ - PRBool fpf; /* If PR_TRUE, first page first */ - PRBool grayscale; /* If PR_TRUE, print grayscale */ - int size; /* Paper size e.g., SizeLetter */ - int orientation; /* Page orientation, e.g. portrait */ - char command[ PATH_MAX ]; /* Print command e.g., lpr */ - char path[ PATH_MAX ]; /* If toPrinter = PR_FALSE, dest file */ - char printer[256]; /* Printer name */ - int copies; /* number of copies */ - PRBool cancel; /* If PR_TRUE, user cancelled */ - float left; /* left margin */ - float right; /* right margin */ - float top; /* top margin */ - float bottom; /* bottom margin */ -} BeOSPrData; - -//void BeOSPrDialog(UnixPrData *prData); - -PR_END_EXTERN_C - -#endif /* !defined(nsPrintdBeOS_h___) */ diff --git a/widget/src/beos/nsScreenBeOS.cpp b/widget/src/beos/nsScreenBeOS.cpp deleted file mode 100644 index d1760528a40c..000000000000 --- a/widget/src/beos/nsScreenBeOS.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsScreenBeOS.h" - -#include - -nsScreenBeOS :: nsScreenBeOS ( ) -{ - // nothing else to do. I guess we could cache a bunch of information - // here, but we want to ask the device at runtime in case anything - // has changed. -} - - -nsScreenBeOS :: ~nsScreenBeOS() -{ - // nothing to see here. -} - - -// addref, release, QI -NS_IMPL_ISUPPORTS1(nsScreenBeOS, nsIScreen) - - -NS_IMETHODIMP -nsScreenBeOS :: GetRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRInt32 *outHeight) -{ - BScreen screen; - - *outTop = 0; - *outLeft = 0; - *outWidth = PRInt32(screen.Frame().Width()+1); - *outHeight = PRInt32(screen.Frame().Height()+1); - - return NS_OK; - -} // GetRect - - -NS_IMETHODIMP -nsScreenBeOS :: GetAvailRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRInt32 *outHeight) -{ - BScreen screen; - - *outTop = 0; - *outLeft = 0; - *outWidth = PRInt32(screen.Frame().Width()+1); - *outHeight = PRInt32(screen.Frame().Height()+1); - - return NS_OK; - -} // GetAvailRect - - -NS_IMETHODIMP -nsScreenBeOS :: GetPixelDepth(PRInt32 *aPixelDepth) -{ - BScreen screen; - - color_space depth; - PRInt32 pixelDepth; - - depth = screen.ColorSpace(); - switch(depth) - { - case B_CMAP8: - pixelDepth = 8; - break; - case B_RGB32: - pixelDepth = 32; - break; - case B_RGB15: - pixelDepth = 15; - break; - case B_RGB16: - pixelDepth = 16; - break; - default: - NS_NOTREACHED("FIXME: Please add this screen depth to the code nsScreenBeOS.cpp"); - pixelDepth = 32; - break; - } - *aPixelDepth = pixelDepth; - - return NS_OK; - -} // GetPixelDepth - - -NS_IMETHODIMP -nsScreenBeOS :: GetColorDepth(PRInt32 *aColorDepth) -{ - return GetPixelDepth ( aColorDepth ); - -} // GetColorDepth - - diff --git a/widget/src/beos/nsScreenBeOS.h b/widget/src/beos/nsScreenBeOS.h deleted file mode 100644 index d7a7d2c09d5f..000000000000 --- a/widget/src/beos/nsScreenBeOS.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsScreenBeOS_h___ -#define nsScreenBeOS_h___ - -#include "nsIScreen.h" - -//------------------------------------------------------------------------ - -class nsScreenBeOS : public nsIScreen -{ -public: - nsScreenBeOS ( ); - virtual ~nsScreenBeOS(); - - NS_DECL_ISUPPORTS - NS_DECL_NSISCREEN - -private: - -}; - -#endif // nsScreenBeOS_h___ diff --git a/widget/src/beos/nsScreenManagerBeOS.cpp b/widget/src/beos/nsScreenManagerBeOS.cpp deleted file mode 100644 index e9196d90fbe4..000000000000 --- a/widget/src/beos/nsScreenManagerBeOS.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsScreenManagerBeOS.h" -#include "nsScreenBeOS.h" - - -nsScreenManagerBeOS :: nsScreenManagerBeOS ( ) -{ - // nothing else to do. I guess we could cache a bunch of information - // here, but we want to ask the device at runtime in case anything - // has changed. -} - - -nsScreenManagerBeOS :: ~nsScreenManagerBeOS() -{ - // nothing to see here. -} - - -// addref, release, QI -NS_IMPL_ISUPPORTS1(nsScreenManagerBeOS, nsIScreenManager) - - -// -// CreateNewScreenObject -// -// Utility routine. Creates a new screen object from the given device handle -// -// NOTE: For this "single-monitor" impl, we just always return the cached primary -// screen. This should change when a multi-monitor impl is done. -// -nsIScreen* -nsScreenManagerBeOS :: CreateNewScreenObject ( ) -{ - nsIScreen* retval = nsnull; - if ( !mCachedMainScreen ) - mCachedMainScreen = new nsScreenBeOS ( ); - NS_IF_ADDREF(retval = mCachedMainScreen.get()); - - return retval; -} - - -// -// ScreenForRect -// -// Returns the screen that contains the rectangle. If the rect overlaps -// multiple screens, it picks the screen with the greatest area of intersection. -// -// The coordinates are in pixels (not twips) and in screen coordinates. -// -NS_IMETHODIMP -nsScreenManagerBeOS :: ScreenForRect ( PRInt32 /*inLeft*/, PRInt32 /*inTop*/, PRInt32 /*inWidth*/, - PRInt32 /*inHeight*/, nsIScreen **outScreen ) -{ - GetPrimaryScreen ( outScreen ); - return NS_OK; - -} // ScreenForRect - - -// -// GetPrimaryScreen -// -// The screen with the menubar/taskbar. This shouldn't be needed very -// often. -// -NS_IMETHODIMP -nsScreenManagerBeOS :: GetPrimaryScreen(nsIScreen * *aPrimaryScreen) -{ - *aPrimaryScreen = CreateNewScreenObject(); // addrefs - return NS_OK; - -} // GetPrimaryScreen - - -// -// GetNumberOfScreens -// -// Returns how many physical screens are available. -// -NS_IMETHODIMP -nsScreenManagerBeOS :: GetNumberOfScreens(PRUint32 *aNumberOfScreens) -{ - *aNumberOfScreens = 1; - return NS_OK; - -} // GetNumberOfScreens - -NS_IMETHODIMP -nsScreenManagerBeOS :: ScreenForNativeWidget(void *nativeWidget, nsIScreen **aScreen) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} diff --git a/widget/src/beos/nsScreenManagerBeOS.h b/widget/src/beos/nsScreenManagerBeOS.h deleted file mode 100644 index 81a5a562075e..000000000000 --- a/widget/src/beos/nsScreenManagerBeOS.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsScreenManagerBeOS_h___ -#define nsScreenManagerBeOS_h___ - -#include "nsIScreenManager.h" -#include "nsIScreen.h" -#include "nsCOMPtr.h" - -//------------------------------------------------------------------------ - -class nsScreenManagerBeOS : public nsIScreenManager -{ -public: - nsScreenManagerBeOS ( ); - virtual ~nsScreenManagerBeOS(); - - NS_DECL_ISUPPORTS - NS_DECL_NSISCREENMANAGER - -private: - - nsIScreen* CreateNewScreenObject ( ) ; - - // cache the primary screen object to avoid memory allocation every time - nsCOMPtr mCachedMainScreen; - -}; - -#endif // nsScreenManagerBeOS_h___ diff --git a/widget/src/beos/nsSound.cpp b/widget/src/beos/nsSound.cpp deleted file mode 100644 index e25736923476..000000000000 --- a/widget/src/beos/nsSound.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#include "nscore.h" -#include "plstr.h" -#include -#include "nsIURL.h" -#include "nsString.h" -#include "nsIFileURL.h" -#include "nsSound.h" -#include "nsNetUtil.h" - -#include "nsDirectoryServiceDefs.h" - -#include "nsNativeCharsetUtils.h" - -#include -#include -#include -#include - - - -NS_IMPL_ISUPPORTS2(nsSound, nsISound, nsIStreamLoaderObserver) - -//////////////////////////////////////////////////////////////////////// -nsSound::nsSound() - : mSound(0) -{ -} - -nsSound::~nsSound() -{ - Init(); -} - -NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, - nsISupports *context, - nsresult aStatus, - PRUint32 dataLen, - const PRUint8 *data) -{ - // print a load error on bad status - if (NS_FAILED(aStatus)) - { -#ifdef DEBUG - printf("Failed load sound file"); -#endif - return aStatus; - } - // In theory, BeOS can play any sound format supported by MediaKit, - // we can also play it from data, but it needs parsing format and - // providing it to sound player, so let MediaKit to do it by self - static const char kSoundTmpFileName[] = "mozsound"; - nsCOMPtr soundTmp; - nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(soundTmp)); - NS_ENSURE_SUCCESS(rv, rv); - rv = soundTmp->AppendNative(nsDependentCString(kSoundTmpFileName)); - NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString soundFilename; - (void) soundTmp->GetNativePath(soundFilename); - FILE *fp = fopen(soundFilename.get(), "wb+"); -#ifdef DEBUG - printf("Playing sound file%s\n",soundFilename.get()); -#endif - if (fp) - { - fwrite(data, 1, dataLen, fp); - fflush(fp); - fclose(fp); - Init(); - mSound = new BSimpleGameSound(soundFilename.get()); - if (mSound != NULL && mSound->InitCheck() == B_OK) - { - mSound->SetIsLooping(false); - mSound->StartPlaying(); - rv = NS_OK; - } - else - { - rv = NS_ERROR_FAILURE; - } - unlink(soundFilename.get()); - } - else - { - return Beep(); - } - return rv; -} - -NS_IMETHODIMP nsSound::Init(void) -{ - if (mSound) - { - mSound->StopPlaying(); - delete mSound; - mSound = NULL; - } - return NS_OK; -} - -NS_METHOD nsSound::Beep() -{ - ::beep(); - return NS_OK; -} - -NS_METHOD nsSound::Play(nsIURL *aURL) -{ - nsresult rv; - nsCOMPtr loader; - rv = NS_NewStreamLoader(getter_AddRefs(loader), aURL, this); - return rv; -} - -NS_IMETHODIMP nsSound::PlaySystemSound(const nsAString &aSoundAlias) -{ - nsresult rv = NS_ERROR_FAILURE; - if (NS_IsMozAliasSound(aSoundAlias)) { - NS_WARNING("nsISound::playSystemSound is called with \"_moz_\" events, they are obsolete, use nsISound::playEventSound instead"); - if (aSoundAlias.Equals(NS_SYSSOUND_MAIL_BEEP)) - return Beep(); - return NS_OK; - } - nsCOMPtr fileURI; - // create a nsILocalFile and then a nsIFileURL from that - nsCOMPtr soundFile; - rv = NS_NewLocalFile(aSoundAlias, PR_TRUE, - getter_AddRefs(soundFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = NS_NewFileURI(getter_AddRefs(fileURI), soundFile); - NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr fileURL = do_QueryInterface(fileURI, &rv); - NS_ENSURE_SUCCESS(rv, rv); - rv = Play(fileURL); - return rv; -} - -NS_IMETHODIMP nsSound::PlayEventSound(PRUint32 aEventId) -{ - return aEventId == EVENT_NEW_MAIL_RECEIVED ? Beep() : NS_OK; -} diff --git a/widget/src/beos/nsSound.h b/widget/src/beos/nsSound.h deleted file mode 100644 index 5a70529d2f5a..000000000000 --- a/widget/src/beos/nsSound.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef __nsSound_h__ -#define __nsSound_h__ - -#include "nsISound.h" -#include "nsIStreamLoader.h" - -class BSimpleGameSound; - -class nsSound : public nsISound, - public nsIStreamLoaderObserver -{ -public: - nsSound(); - virtual ~nsSound(); - - NS_DECL_ISUPPORTS - NS_DECL_NSISOUND - NS_DECL_NSISTREAMLOADEROBSERVER -private: - BSimpleGameSound *mSound; -}; - -#endif /* __nsSound_h__ */ diff --git a/widget/src/beos/nsSwitchToUIThread.h b/widget/src/beos/nsSwitchToUIThread.h deleted file mode 100644 index f41d114cf647..000000000000 --- a/widget/src/beos/nsSwitchToUIThread.h +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef SWITCHTOUITHREAD_H -#define SWITCHTOUITHREAD_H - -#include "nsISupports.h" - -// foreward declaration -struct MethodInfo; - - -#define WM_CALLMETHOD 'CAme' - -/** - * Switch thread to match the thread the widget was created in so messages will be dispatched. - */ - -class nsSwitchToUIThread { - -public: - virtual bool CallMethod(MethodInfo *info) = 0; - - // Enumeration of the methods which are accessable on the "main GUI thread" - // via the CallMethod(...) mechanism... - // see nsSwitchToUIThread - enum - { - CREATE = 0x0101, - CREATE_NATIVE, - DESTROY, - SET_FOCUS, - GOT_FOCUS, - KILL_FOCUS, - ONMOUSE, - ONDROP, - ONWHEEL, - ONPAINT, - ONRESIZE, - CLOSEWINDOW, - ONKEY, - BTNCLICK, - ONACTIVATE, - ONMOVE, - ONWORKSPACE -#if defined(BeIME) - , - ONIME -#endif - }; - -}; - -// -// Structure used for passing the information necessary for synchronously -// invoking a method on the GUI thread... -// -struct MethodInfo { - nsISupports *widget; - nsSwitchToUIThread *target; - uint32 methodId; - int nArgs; - uint32 *args; - - MethodInfo(nsISupports *ref, nsSwitchToUIThread *obj, uint32 id, int numArgs = 0, uint32 *arguments = 0) - { - widget = ref; - NS_ADDREF(ref); - target = obj; - methodId = id; - nArgs = numArgs; - args = new uint32 [numArgs]; - memcpy(args, arguments, sizeof(uint32) * numArgs); - } - - ~MethodInfo() - { - delete [] args; - NS_RELEASE(widget); - } - - bool Invoke() { return target->CallMethod(this); } -}; - -#endif // TOUITHRD_H - diff --git a/widget/src/beos/nsToolkit.cpp b/widget/src/beos/nsToolkit.cpp deleted file mode 100644 index a793e8f087b1..000000000000 --- a/widget/src/beos/nsToolkit.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsToolkit.h" -#include "prmon.h" -#include "nsSwitchToUIThread.h" -#include "prprf.h" -#include "nsWidgetAtoms.h" - -// -// Static thread local storage index of the Toolkit -// object associated with a given thread... -// -static PRUintn gToolkitTLSIndex = 0; - -//------------------------------------------------------------------------- -// -// nsISupports implementation macro -// -//------------------------------------------------------------------------- -NS_IMPL_THREADSAFE_ISUPPORTS1(nsToolkit, nsIToolkit) - -struct ThreadInterfaceData -{ - void *data; - thread_id waitingThread; -}; - -// -// main for the message pump thread -// -PRBool gThreadState = PR_FALSE; - -struct ThreadInitInfo { - PRMonitor *monitor; - nsToolkit *toolkit; -}; - -void nsToolkit::RunPump(void* arg) -{ - int32 code; - char portname[64]; - ThreadInterfaceData id; -#ifdef DEBUG - printf("TK-RunPump\n"); -#endif - ThreadInitInfo *info = (ThreadInitInfo*)arg; - PR_EnterMonitor(info->monitor); - - gThreadState = PR_TRUE; - - PR_Notify(info->monitor); - PR_ExitMonitor(info->monitor); - - delete info; - - // system wide unique names - PR_snprintf(portname, sizeof(portname), "event%lx", - (long unsigned) PR_GetCurrentThread()); - - port_id event = create_port(200, portname); - - while(read_port_etc(event, &code, &id, sizeof(id), B_TIMEOUT, 1000) >= 0) - { - MethodInfo *mInfo = (MethodInfo *)id.data; - mInfo->Invoke(); - if(id.waitingThread != 0) - resume_thread(id.waitingThread); - delete mInfo; - } -} - -//------------------------------------------------------------------------- -// -// constructor -// -//------------------------------------------------------------------------- -nsToolkit::nsToolkit() -{ - localthread = false; - mGuiThread = NULL; -} - - -//------------------------------------------------------------------------- -// -// destructor -// -//------------------------------------------------------------------------- -nsToolkit::~nsToolkit() -{ - Kill(); - PR_SetThreadPrivate(gToolkitTLSIndex, nsnull); -} - -void nsToolkit::Kill() -{ - if(localthread) - { - GetInterface(); - // interrupt message flow - close_port(eventport); - } -} - -//------------------------------------------------------------------------- -// -// Create a new thread and run the message pump in there -// -//------------------------------------------------------------------------- -void nsToolkit::CreateUIThread() -{ -#ifdef DEBUG - printf("TK-CUIT\n"); -#endif - PRMonitor *monitor = ::PR_NewMonitor(); - - PR_EnterMonitor(monitor); - - ThreadInitInfo *ti = new ThreadInitInfo(); - if (ti) - { - ti->monitor = monitor; - ti->toolkit = this; - - // create a gui thread - mGuiThread = PR_CreateThread(PR_SYSTEM_THREAD, - RunPump, - (void*)ti, - PR_PRIORITY_HIGH, - PR_LOCAL_THREAD, - PR_UNJOINABLE_THREAD, - 0); - - // wait for the gui thread to start - while(!gThreadState) - { - PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT); - } - } - - // at this point the thread is running - PR_ExitMonitor(monitor); - PR_DestroyMonitor(monitor); -} - - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -NS_METHOD nsToolkit::Init(PRThread *aThread) -{ -#ifdef DEBUG - printf("TKInit\n"); -#endif - Kill(); - // Store the thread ID of the thread containing the message pump. - // If no thread is provided create one - if (NULL != aThread) - { - mGuiThread = aThread; - localthread = false; - } - else - { - localthread = true; - // create a thread where the message pump will run - CreateUIThread(); - } - - cached = false; - - nsWidgetAtoms::RegisterAtoms(); - - return NS_OK; -} - -void nsToolkit::GetInterface() -{ -#ifdef DEBUG - printf("TK-GI\n"); -#endif - if(! cached) - { - char portname[64]; - - PR_snprintf(portname, sizeof(portname), "event%lx", - (long unsigned) mGuiThread); - - eventport = find_port(portname); - - cached = true; - } -} - -// Synchronous version, not in use at the moment -bool nsToolkit::CallMethod(MethodInfo *info) -{ -#ifdef DEBUG - printf("TK-CM\n"); -#endif - ThreadInterfaceData id; - - GetInterface(); - - id.data = info; - id.waitingThread = find_thread(NULL); - // Check message count to not exceed the port's capacity. - // There seems to be a BeOS bug that allows more - // messages on a port than its capacity. - port_info portinfo; - if (get_port_info(eventport, &portinfo) != B_OK) - { - return false; - } - - if (port_count(eventport) < portinfo.capacity - 20) - { - // If we cannot write inside 5 seconds, something is really wrong. - if(write_port_etc(eventport, WM_CALLMETHOD, &id, sizeof(id), B_TIMEOUT, 5000000) == B_OK) - { - // semantics for CallMethod are that it should be synchronous - suspend_thread(id.waitingThread); - return true; - } - } - return false; -} - -// to be used only from a BView or BWindow -bool nsToolkit::CallMethodAsync(MethodInfo *info) -{ -#ifdef DEBUG - printf("CMA\n"); -#endif - ThreadInterfaceData id; - - GetInterface(); - - id.data = info; - id.waitingThread = 0; - - // Check message count to not exceed the port's capacity. - // There seems to be a BeOS bug that allows more - // messages on a port than its capacity. - port_info portinfo; - if (get_port_info(eventport, &portinfo) != B_OK) - { - return false; - } - - if (port_count(eventport) < portinfo.capacity - 20) - { - if(write_port_etc(eventport, WM_CALLMETHOD, &id, sizeof(id), B_TIMEOUT, 0) == B_OK) - { - return true; - } - } - return false; -} - -//------------------------------------------------------------------------- -// -// Return the nsIToolkit for the current thread. If a toolkit does not -// yet exist, then one will be created... -// -//------------------------------------------------------------------------- -NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult) -{ - nsIToolkit* toolkit = nsnull; - nsresult rv = NS_OK; - PRStatus status; -#ifdef DEBUG - printf("TK-GetCTK\n"); -#endif - // Create the TLS index the first time through... - if (0 == gToolkitTLSIndex) - { - status = PR_NewThreadPrivateIndex(&gToolkitTLSIndex, NULL); - if (PR_FAILURE == status) - { - rv = NS_ERROR_FAILURE; - } - } - - if (NS_SUCCEEDED(rv)) - { - toolkit = (nsIToolkit*)PR_GetThreadPrivate(gToolkitTLSIndex); - - // - // Create a new toolkit for this thread... - // - if (!toolkit) - { - toolkit = new nsToolkit(); - - if (!toolkit) - { - rv = NS_ERROR_OUT_OF_MEMORY; - } - else - { - NS_ADDREF(toolkit); - toolkit->Init(PR_GetCurrentThread()); - // - // The reference stored in the TLS is weak. It is removed in the - // nsToolkit destructor... - // - PR_SetThreadPrivate(gToolkitTLSIndex, (void*)toolkit); - } - } - else - { - NS_ADDREF(toolkit); - } - *aResult = toolkit; - } - - return rv; -} diff --git a/widget/src/beos/nsToolkit.h b/widget/src/beos/nsToolkit.h deleted file mode 100644 index 65eaee74290f..000000000000 --- a/widget/src/beos/nsToolkit.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef TOOLKIT_H -#define TOOLKIT_H - -#include "nsIToolkit.h" - -#include - -struct MethodInfo; - -/** - * Wrapper around the thread running the message pump. - * The toolkit abstraction is necessary because the message pump must - * execute within the same thread that created the widget under Win32. - */ - -class nsToolkit : public nsIToolkit -{ -public: - NS_DECL_ISUPPORTS - - nsToolkit(); - NS_IMETHOD Init(PRThread *aThread); - bool CallMethod(MethodInfo *info); - bool CallMethodAsync(MethodInfo *info); - // Return whether the current thread is the application's Gui thread. - PRBool IsGuiThread(void) { return (PRBool)(mGuiThread == PR_GetCurrentThread());} - PRThread* GetGuiThread(void) { return mGuiThread; } - void Kill(); -private: - virtual ~nsToolkit(); - void CreateUIThread(void); - -protected: - // Thread Id of the "main" Gui thread. - PRThread *mGuiThread; - static void RunPump(void* arg); - void GetInterface(); - bool cached; - bool localthread; - port_id eventport; -}; - -#endif // TOOLKIT_H diff --git a/widget/src/beos/nsWidgetFactory.cpp b/widget/src/beos/nsWidgetFactory.cpp deleted file mode 100644 index 11af2a5bed2a..000000000000 --- a/widget/src/beos/nsWidgetFactory.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Christopher Blizzard. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * John C. Griggs - * Dan Rosen - * Paul Ashford - * Fredrik Holmqvist - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIGenericFactory.h" -#include "nsIModule.h" -#include "nsCOMPtr.h" -#include "nsWidgetsCID.h" - -#include "nsWindow.h" -#include "nsPopupWindow.h" -#include "nsChildView.h" -#include "nsSound.h" -#include "nsToolkit.h" -#include "nsAppShell.h" -#include "nsAppShellSingleton.h" -#include "nsLookAndFeel.h" -#include "nsFilePicker.h" -#include "nsBidiKeyboard.h" -#include "nsScreenManagerBeOS.h" -// Printing: -// aka nsDeviceContextSpecBeOS.h -#include "nsDeviceContextSpecB.h" -#include "nsPrintOptionsBeOS.h" -#include "nsPrintSession.h" - -// Drag & Drop, Clipboard -#include "nsTransferable.h" -#include "nsClipboard.h" -#include "nsClipboardHelper.h" -#include "nsHTMLFormatConverter.h" -#include "nsDragService.h" - - -NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsPopupWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildView) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerBeOS) - -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecBeOS) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsBeOS, Init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorBeOS) - -static const nsModuleComponentInfo components[] = -{ - { "BeOS nsWindow", - NS_WINDOW_CID, - "@mozilla.org/widgets/window/beos;1", - nsWindowConstructor }, - { "BeOS Popup nsWindow", - NS_POPUP_CID, - "@mozilla.org/widgets/popup/beos;1", - nsPopupWindowConstructor }, - { "BeOS Child nsWindow", - NS_CHILD_CID, - "@mozilla.org/widgets/view/beos;1", - nsChildViewConstructor }, - { "BeOS AppShell", - NS_APPSHELL_CID, - "@mozilla.org/widget/appshell/beos;1", - nsAppShellConstructor }, - { "BeOS Toolkit", - NS_TOOLKIT_CID, - "@mozilla.org/widget/toolkit/beos;1", - nsToolkitConstructor }, - { "BeOS Look And Feel", - NS_LOOKANDFEEL_CID, - "@mozilla.org/widget/lookandfeel;1", - nsLookAndFeelConstructor }, - { "Transferrable", - NS_TRANSFERABLE_CID, - "@mozilla.org/widget/transferable;1", - nsTransferableConstructor }, - { "BeOS Clipboard", - NS_CLIPBOARD_CID, - "@mozilla.org/widget/clipboard;1", - nsClipboardConstructor }, - { "Clipboard Helper", - NS_CLIPBOARDHELPER_CID, - "@mozilla.org/widget/clipboardhelper;1", - nsClipboardHelperConstructor }, - { "HTML Format Converter", - NS_HTMLFORMATCONVERTER_CID, - "@mozilla.org/widget/htmlformatconverter;1", - nsHTMLFormatConverterConstructor }, - { "BeOS Sound", - NS_SOUND_CID, - "@mozilla.org/sound;1", - nsSoundConstructor }, - { "BeOS Drag Service", - NS_DRAGSERVICE_CID, - "@mozilla.org/widget/dragservice;1", - nsDragServiceConstructor }, - { "BeOS Bidi Keyboard", - NS_BIDIKEYBOARD_CID, - "@mozilla.org/widget/bidikeyboard;1", - nsBidiKeyboardConstructor }, - { "BeOS File Picker", - NS_FILEPICKER_CID, - "@mozilla.org/filepicker;1", - nsFilePickerConstructor }, - { "BeOS Screen Manager", - NS_SCREENMANAGER_CID, - "@mozilla.org/gfx/screenmanager;1", - nsScreenManagerBeOSConstructor }, - { "BeOS Device Context Spec", - NS_DEVICE_CONTEXT_SPEC_CID, - // "@mozilla.org/gfx/device_context_spec/beos;1", - "@mozilla.org/gfx/devicecontextspec;1", - nsDeviceContextSpecBeOSConstructor }, - { "BeOS Printer Enumerator", - NS_PRINTER_ENUMERATOR_CID, - // "@mozilla.org/gfx/printer_enumerator/beos;1", - "@mozilla.org/gfx/printerenumerator;1", - nsPrinterEnumeratorBeOSConstructor }, - { "BeOS PrintSettings Service", - NS_PRINTSETTINGSSERVICE_CID, - "@mozilla.org/gfx/printsettings-service;1", - nsPrintOptionsBeOSConstructor }, - { "Print Session", - NS_PRINTSESSION_CID, - "@mozilla.org/gfx/printsession;1", - nsPrintSessionConstructor } -}; - -NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsWidgetBeOSModule, - components, - nsAppShellInit, nsAppShellShutdown) diff --git a/widget/src/beos/nsWindow.cpp b/widget/src/beos/nsWindow.cpp deleted file mode 100644 index 47368da85b38..000000000000 --- a/widget/src/beos/nsWindow.cpp +++ /dev/null @@ -1,3176 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Paul Ashford - * Sergei Dolgov - * Fredrik Holmqvist - * Mats Palmgren - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsDebug.h" -#include "nsWindow.h" -#include "nsIAppShell.h" -#include "nsIFontMetrics.h" -#include "nsFont.h" -#include "nsGUIEvent.h" -#include "nsWidgetsCID.h" -#include "nsIDragService.h" -#include "nsIDragSessionBeOS.h" -#include "nsIDeviceContext.h" -#include "nsRect.h" -#include "nsIRegion.h" -#include "nsTransform2D.h" -#include "nsGfxCIID.h" -#include "resource.h" -#include "prtime.h" -#include "nsReadableUtils.h" -#include "nsTPtrArray.h" -#include "nsIProxyObjectManager.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#if defined(BeIME) -#include -#include -#include -#endif -#include "nsIRollupListener.h" -#include "nsIMenuRollup.h" - -#include "gfxBeOSSurface.h" -#include "gfxContext.h" - -// See comments in nsWindow.h as to why we override these calls from nsBaseWidget -NS_IMPL_THREADSAFE_ADDREF(nsWindow) -NS_IMPL_THREADSAFE_RELEASE(nsWindow) - -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kRegionCID, NS_REGION_CID); -static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID); -//------------------------------------------------------------------------- -// Global Definitions -//------------------------------------------------------------------------- - -// Rollup Listener - static variable defintions -static nsIRollupListener * gRollupListener = nsnull; -static nsIMenuRollup * gMenuRollup = nsnull; -static nsIWidget * gRollupWidget = nsnull; -static PRBool gRollupConsumeRollupEvent = PR_FALSE; -// Tracking last activated BWindow -static BWindow * gLastActiveWindow = NULL; - -// BCursor objects can't be created until they are used. Some mozilla utilities, -// such as regxpcom, do not create a BApplication object, and therefor fail to run., -// since a BCursor requires a vaild BApplication (see Bug#129964). But, we still want -// to cache them for performance. Currently, there are 17 cursors available; -static nsTPtrArray gCursorArray(21); -// Used in contrain position. Specifies how much of a window must remain on screen -#define kWindowPositionSlop 20 -// BeOS does not provide this information, so we must hard-code it -#define kWindowBorderWidth 5 -#define kWindowTitleBarHeight 24 - -// TODO: make a #def for using OutLine view or not (see TODO below) -#if defined(BeIME) -#include "nsUTF8Utils.h" -static inline uint32 utf8_str_len(const char* ustring, int32 length) -{ - CalculateUTF8Length cutf8; - cutf8.write(ustring, length); - return cutf8.Length(); -} - -nsIMEBeOS::nsIMEBeOS() - : imeTarget(NULL) - , imeState(NS_COMPOSITION_END), imeWidth(14) -{ -} -/* placeholder for possible cleanup -nsIMEBeOS::~nsIMEBeOS() -{ -} -*/ -void nsIMEBeOS::RunIME(uint32 *args, nsWindow *target, BView *fView) -{ - BMessage msg; - msg.Unflatten((const char*)args); - - switch (msg.FindInt32("be:opcode")) - { - case B_INPUT_METHOD_CHANGED: - if (msg.HasString("be:string")) - { - const char* src = msg.FindString("be:string"); - CopyUTF8toUTF16(src, imeText); - - if (msg.FindBool("be:confirmed")) - { - if (imeState != NS_COMPOSITION_END) - DispatchText(imeText, 0, NULL); - } - else - { - nsTextRange txtRuns[2]; - PRUint32 txtCount = 2; - - int32 select[2]; - select[0] = msg.FindInt32("be:selection", int32(0)); - select[1] = msg.FindInt32("be:selection", 1); - - txtRuns[0].mStartOffset = (select[0] == select[1]) ? 0 : utf8_str_len(src, select[1]); - txtRuns[0].mEndOffset = imeText.Length(); - txtRuns[0].mRangeType = NS_TEXTRANGE_CONVERTEDTEXT; - if (select[0] == select[1]) - txtCount = 1; - else - { - txtRuns[1].mStartOffset = utf8_str_len(src, select[0]); - txtRuns[1].mEndOffset = utf8_str_len(src, select[1]); - txtRuns[1].mRangeType = NS_TEXTRANGE_SELECTEDCONVERTEDTEXT; - } - imeTarget = target; - DispatchText(imeText, txtCount, txtRuns); - } - } - break; - - case B_INPUT_METHOD_LOCATION_REQUEST: -// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect. -#if 0 - if (fView && fView->LockLooper()) - { - BPoint caret(imeCaret); - DispatchIME(NS_COMPOSITION_QUERY); - if (caret.x > imeCaret.x) - caret.x = imeCaret.x - imeWidth * imeText.Length(); /* back */ - - BMessage reply(B_INPUT_METHOD_EVENT); - reply.AddInt32("be:opcode", B_INPUT_METHOD_LOCATION_REQUEST); - for (int32 s= 0; imeText[s]; s++) - { - reply.AddPoint("be:location_reply", fView->ConvertToScreen(caret)); - reply.AddFloat("be:height_reply", imeHeight); - caret.x += imeWidth; - } - imeMessenger.SendMessage(&reply); - fView->UnlockLooper(); - } -#endif - break; - - case B_INPUT_METHOD_STARTED: - imeTarget = target; - DispatchIME(NS_COMPOSITION_START); -// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect. -#if 0 - DispatchIME(NS_COMPOSITION_QUERY); -#endif - msg.FindMessenger("be:reply_to", &imeMessenger); - break; - - case B_INPUT_METHOD_STOPPED: - if (imeState != NS_COMPOSITION_END) - DispatchIME(NS_COMPOSITION_END); - imeText.Truncate(); - break; - }; -} - -void nsIMEBeOS::DispatchText(nsString &text, PRUint32 txtCount, nsTextRange* txtRuns) -{ - nsTextEvent textEvent(PR_TRUE,NS_TEXT_TEXT, imeTarget); - - textEvent.time = 0; - textEvent.isShift = - textEvent.isControl = - textEvent.isAlt = - textEvent.isMeta = PR_FALSE; - - textEvent.refPoint.x = - textEvent.refPoint.y = 0; - - textEvent.theText = text.get(); - textEvent.isChar = PR_TRUE; - textEvent.rangeCount= txtCount; - textEvent.rangeArray= txtRuns; - - DispatchWindowEvent(&textEvent); -} - -void nsIMEBeOS::DispatchCancelIME() -{ - if (imeText.Length() && imeState != NS_COMPOSITION_END) - { - BMessage reply(B_INPUT_METHOD_EVENT); - reply.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED); - imeMessenger.SendMessage(&reply); - - DispatchText(imeText, 0, NULL); - DispatchIME(NS_COMPOSITION_END); - - imeText.Truncate(); - } -} - -void nsIMEBeOS::DispatchIME(PRUint32 what) -{ - nsCompositionEvent compEvent(PR_TRUE, what, imeTarget); - - compEvent.refPoint.x = - compEvent.refPoint.y = 0; - compEvent.time = 0; - - DispatchWindowEvent(&compEvent); - imeState = what; - -// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect. -#if 0 - if (what == NS_COMPOSITION_QUERY) - { - imeCaret.Set(compEvent.theReply.mCursorPosition.x, - compEvent.theReply.mCursorPosition.y); - imeHeight = compEvent.theReply.mCursorPosition.height+4; - } -#endif -} - -PRBool nsIMEBeOS::DispatchWindowEvent(nsGUIEvent* event) -{ - nsEventStatus status; - imeTarget->DispatchEvent(event, status); - return PR_FALSE; -} -// There is only one IME instance per app, actually it may be set as global -nsIMEBeOS *nsIMEBeOS::GetIME() -{ - if(beosIME == 0) - beosIME = new nsIMEBeOS(); - return beosIME; -} -nsIMEBeOS *nsIMEBeOS::beosIME = 0; -#endif -//------------------------------------------------------------------------- -// -// nsWindow constructor -// -//------------------------------------------------------------------------- -nsWindow::nsWindow() : nsBaseWidget() -{ - mView = 0; - mFontMetrics = nsnull; - mIsShiftDown = PR_FALSE; - mIsControlDown = PR_FALSE; - mIsAltDown = PR_FALSE; - mIsDestroying = PR_FALSE; - mIsVisible = PR_FALSE; - mEnabled = PR_TRUE; - mIsScrolling = PR_FALSE; - mParent = nsnull; - mWindowParent = nsnull; - mUpdateArea = do_CreateInstance(kRegionCID); - mForeground = NS_RGBA(0xFF,0xFF,0xFF,0xFF); - mBackground = mForeground; - mBWindowFeel = B_NORMAL_WINDOW_FEEL; - mBWindowLook = B_NO_BORDER_WINDOW_LOOK; - - if (mUpdateArea) - { - mUpdateArea->Init(); - mUpdateArea->SetTo(0, 0, 0, 0); - } -} - - -//------------------------------------------------------------------------- -// -// nsWindow destructor -// -//------------------------------------------------------------------------- -nsWindow::~nsWindow() -{ - mIsDestroying = PR_TRUE; - - // If the widget was released without calling Destroy() then the native - // window still exists, and we need to destroy it - if (NULL != mView) - { - Destroy(); - } - NS_IF_RELEASE(mFontMetrics); -} - -NS_METHOD nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect) -{ - BPoint point; - point.x = aOldRect.x; - point.y = aOldRect.y; - if (mView && mView->LockLooper()) - { - mView->ConvertToScreen(&point); - mView->UnlockLooper(); - } - aNewRect.x = nscoord(point.x); - aNewRect.y = nscoord(point.y); - aNewRect.width = aOldRect.width; - aNewRect.height = aOldRect.height; - return NS_OK; -} - -NS_METHOD nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect) -{ - BPoint point; - point.x = aOldRect.x; - point.y = aOldRect.y; - if (mView && mView->LockLooper()) - { - mView->ConvertFromScreen(&point); - mView->UnlockLooper(); - } - aNewRect.x = nscoord(point.x); - aNewRect.y = nscoord(point.y); - aNewRect.width = aOldRect.width; - aNewRect.height = aOldRect.height; - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Initialize an event to dispatch -// -//------------------------------------------------------------------------- -void nsWindow::InitEvent(nsGUIEvent& event, nsPoint* aPoint) -{ - NS_ADDREF(event.widget); - - if (nsnull == aPoint) // use the point from the event - { - // get the message position in client coordinates and in twips - event.refPoint.x = 0; - event.refPoint.y = 0; - } - else // use the point override if provided - { - event.refPoint.x = aPoint->x; - event.refPoint.y = aPoint->y; - } - event.time = PR_IntervalNow(); -} - -NS_IMETHODIMP nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) -{ - NS_PRECONDITION(aNewParent, ""); - - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Invokes callback and ProcessEvent method on Event Listener object -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) -{ - aStatus = nsEventStatus_eIgnore; - - nsCOMPtr mWidget = event->widget; - - if (mEventCallback) - aStatus = (*mEventCallback)(event); - - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Dispatch Window Event -// -//------------------------------------------------------------------------- -PRBool nsWindow::DispatchWindowEvent(nsGUIEvent* event) -{ - nsEventStatus status; - DispatchEvent(event, status); - return ConvertStatus(status); -} - -//------------------------------------------------------------------------- -// -// Dispatch standard event -// -//------------------------------------------------------------------------- - -PRBool nsWindow::DispatchStandardEvent(PRUint32 aMsg) -{ - nsGUIEvent event(PR_TRUE, aMsg, this); - InitEvent(event); - - PRBool result = DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - return result; -} - -nsresult nsWindow::Create(nsIWidget *aParent, - nsNativeWidget aNativeParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIAppShell *aAppShell, - nsIToolkit *aToolkit, - nsWidgetInitData *aInitData) -{ - - //Do as little as possible for invisible windows, why are these needed? - if (aInitData->mWindowType == eWindowType_invisible) - return NS_ERROR_FAILURE; - - NS_ASSERTION(aInitData->mWindowType == eWindowType_dialog - || aInitData->mWindowType == eWindowType_toplevel, - "The windowtype is not handled by this class."); - - mIsTopWidgetWindow = PR_TRUE; - - BaseCreate(nsnull, aRect, aHandleEventFunction, aContext, - aAppShell, aToolkit, aInitData); - - mListenForResizes = aNativeParent ? PR_TRUE : aInitData->mListenForResizes; - - mParent = aParent; - // Useful shortcut, wondering if we can use it also in GetParent() instead - // nsIWidget* type mParent. - mWindowParent = (nsWindow *)aParent; - SetBounds(aRect); - - // Default mode for window, everything switched off. - uint32 flags = B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE - | B_NOT_CLOSABLE | B_ASYNCHRONOUS_CONTROLS; - - //eBorderStyle_default is to ask the OS to handle it as it sees best. - //eBorderStyle_all is same as top_level window default. - if (eBorderStyle_default == mBorderStyle || eBorderStyle_all & mBorderStyle) - { - //(Firefox prefs doesn't go this way, so apparently it wants titlebar, zoom, - //resize and close.) - - //Look and feel for others are set ok at init. - if (eWindowType_toplevel==mWindowType) - { - mBWindowLook = B_TITLED_WINDOW_LOOK; - flags = B_ASYNCHRONOUS_CONTROLS; - } - } - else - { - if (eBorderStyle_border & mBorderStyle) - mBWindowLook = B_MODAL_WINDOW_LOOK; - - if (eBorderStyle_resizeh & mBorderStyle) - { - //Resize demands at least border - mBWindowLook = B_MODAL_WINDOW_LOOK; - flags &= !B_NOT_RESIZABLE; - } - - //We don't have titlebar menus, so treat like title as it demands titlebar. - if (eBorderStyle_title & mBorderStyle || eBorderStyle_menu & mBorderStyle) - mBWindowLook = B_TITLED_WINDOW_LOOK; - - if (eBorderStyle_minimize & mBorderStyle) - flags &= !B_NOT_MINIMIZABLE; - - if (eBorderStyle_maximize & mBorderStyle) - flags &= !B_NOT_ZOOMABLE; - - if (eBorderStyle_close & mBorderStyle) - flags &= !B_NOT_CLOSABLE; - } - - nsWindowBeOS * w = new nsWindowBeOS(this, - BRect(aRect.x, aRect.y, aRect.x + aRect.width - 1, aRect.y + aRect.height - 1), - "", mBWindowLook, mBWindowFeel, flags); - if (!w) - return NS_ERROR_OUT_OF_MEMORY; - - mView = new nsViewBeOS(this, w->Bounds(), "Toplevel view", B_FOLLOW_ALL, 0); - - if (!mView) - return NS_ERROR_OUT_OF_MEMORY; - - w->AddChild(mView); - // I'm wondering if we can move part of that code to above - if (eWindowType_dialog == mWindowType && mWindowParent) - { - nsWindow *topparent = mWindowParent; - while (topparent->mWindowParent) - topparent = topparent->mWindowParent; - // may be got via mView and mView->Window() of topparent explicitly - BWindow* subsetparent = (BWindow *) - topparent->GetNativeData(NS_NATIVE_WINDOW); - if (subsetparent) - { - mBWindowFeel = B_FLOATING_SUBSET_WINDOW_FEEL; - w->SetFeel(mBWindowFeel); - w->AddToSubset(subsetparent); - } - } - // Run Looper. No proper destroy without it. - w->Run(); - DispatchStandardEvent(NS_CREATE); - return NS_OK; -} - -gfxASurface* -nsWindow::GetThebesSurface() -{ - mThebesSurface = nsnull; - if (!mThebesSurface) { - mThebesSurface = new gfxBeOSSurface(mView); - } - return mThebesSurface; -} - -//------------------------------------------------------------------------- -// -// Close this nsWindow -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Destroy() -{ - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - nsToolkit* toolkit = (nsToolkit *)mToolkit; - if (toolkit != nsnull && !toolkit->IsGuiThread()) - { - nsCOMPtr widgetProxy; - nsresult rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIWidget), - this, - NS_PROXY_SYNC | NS_PROXY_ALWAYS, - getter_AddRefs(widgetProxy)); - - if (NS_FAILED(rv)) - return rv; - return widgetProxy->Destroy(); - } - // Ok, now tell the nsBaseWidget class to clean up what it needs to - if (!mIsDestroying) - { - nsBaseWidget::Destroy(); - } - //our windows can be subclassed by - //others and these namless, faceless others - //may not let us know about WM_DESTROY. so, - //if OnDestroy() didn't get called, just call - //it now. - if (PR_FALSE == mOnDestroyCalled) - OnDestroy(); - - // Destroy the BView, if no mView, it is probably destroyed before - // automatically with BWindow::Quit() - if (mView) - { - // prevent the widget from causing additional events - mEventCallback = nsnull; - - if (mView->LockLooper()) - { - while(mView->ChildAt(0)) - mView->RemoveChild(mView->ChildAt(0)); - // destroy from inside - BWindow *w = mView->Window(); - // if no window, it was destroyed as result of B_QUIT_REQUESTED and - // took also all its children away - if (w) - { - w->Sync(); - if (mView->Parent()) - { - mView->Parent()->RemoveChild(mView); - if (eWindowType_child != mWindowType && - eWindowType_plugin != mWindowType) - w->Quit(); - else - w->Unlock(); - } - else - { - w->RemoveChild(mView); - w->Quit(); - } - } - else - mView->RemoveSelf(); - - delete mView; - } - - // window is already gone - mView = NULL; - } - mParent = nsnull; - mWindowParent = nsnull; - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Get this nsWindow parent -// -//------------------------------------------------------------------------- -nsIWidget* nsWindow::GetParent(void) -{ - //We cannot addref mParent directly - nsIWidget *widget = 0; - if (mIsDestroying || mOnDestroyCalled) - return nsnull; - widget = (nsIWidget *)mParent; - return widget; -} - - -//------------------------------------------------------------------------- -// -// Hide or show this component -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Show(PRBool bState) -{ - if (!mEnabled) - return NS_OK; - - - if (!mView || !mView->LockLooper()) - return NS_OK; - - //We need to do the IsHidden() checks - //because BeOS counts no of Hide() - //and Show() checks. BeBook: - // If Hide() is called more than once, you'll need to call Show() - // an equal number of times for the window to become visible again. - if (!bState) - { - if (mView->Window() && !mView->Window()->IsHidden()) - mView->Window()->Hide(); - } - else - { - if (mView->Window() && mView->Window()->IsHidden()) - mView->Window()->Show(); - } - - mView->UnlockLooper(); - mIsVisible = bState; - - return NS_OK; -} -//------------------------------------------------------------------------- -// Set/unset mouse capture -//------------------------------------------------------------------------- -NS_METHOD nsWindow::CaptureMouse(PRBool aCapture) -{ - if (mView && mView->LockLooper()) - { - if (PR_TRUE == aCapture) - mView->SetEventMask(B_POINTER_EVENTS); - else - mView->SetEventMask(0); - mView->UnlockLooper(); - } - return NS_OK; -} -//------------------------------------------------------------------------- -// Capture Roolup Events -//------------------------------------------------------------------------- -NS_METHOD nsWindow::CaptureRollupEvents(nsIRollupListener * aListener, - nsIMenuRollup * aMenuRollup, - PRBool aDoCapture, - PRBool aConsumeRollupEvent) -{ - if (!mEnabled) - return NS_OK; - - if (aDoCapture) - { - // we haven't bothered carrying a weak reference to gRollupWidget because - // we believe lifespan is properly scoped. this next assertion helps - // assure that remains true. - NS_ASSERTION(!gRollupWidget, "rollup widget reassigned before release"); - gRollupConsumeRollupEvent = aConsumeRollupEvent; - NS_IF_RELEASE(gRollupWidget); - gRollupListener = aListener; - NS_IF_RELEASE(gMenuRollup); - gMenuRollup = aMenuRollup; - NS_IF_ADDREF(aMenuRollup); - gRollupWidget = this; - NS_ADDREF(this); - } - else - { - gRollupListener == nsnull; - NS_IF_RELEASE(gMenuRollup); - NS_IF_RELEASE(gRollupWidget); - } - - return NS_OK; -} - -//------------------------------------------------------------------------- -// Check if event happened inside the given nsWindow -//------------------------------------------------------------------------- -PRBool nsWindow::EventIsInsideWindow(nsWindow* aWindow, nsPoint pos) -{ - BRect r; - BWindow *window = (BWindow *)aWindow->GetNativeData(NS_NATIVE_WINDOW); - if (window) - { - r = window->Frame(); - } - else - { - // Bummer! - return PR_FALSE; - } - - if (pos.x < r.left || pos.x > r.right || - pos.y < r.top || pos.y > r.bottom) - { - return PR_FALSE; - } - - return PR_TRUE; -} - -//------------------------------------------------------------------------- -// DealWithPopups -// -// Handle events that may cause a popup (combobox, XPMenu, etc) to need to rollup. -//------------------------------------------------------------------------- -PRBool -nsWindow::DealWithPopups(uint32 methodID, nsPoint pos) -{ - if (gRollupListener && gRollupWidget) - { - // Rollup if the event is outside the popup. - PRBool rollup = !nsWindow::EventIsInsideWindow((nsWindow*)gRollupWidget, pos); - - // If we're dealing with menus, we probably have submenus and we don't - // want to rollup if the click is in a parent menu of the current submenu. - if (rollup) - { - if ( gMenuRollup ) - { - nsAutoTArray widgetChain; - gMenuRollup->GetSubmenuWidgetChain(&widgetChain); - - for ( PRUint32 i = 0; i < widgetChain.Length(); ++i ) - { - nsIWidget* widget = widgetChain[i]; - if ( nsWindow::EventIsInsideWindow((nsWindow*)widget, pos) ) - { - rollup = PR_FALSE; - break; - } - } // foreach parent menu widget - } // if rollup listener knows about menus - } // if rollup - - if (rollup) - { - gRollupListener->Rollup(); - - if (gRollupConsumeRollupEvent) - { - return PR_TRUE; - } - } - } // if rollup listeners registered - - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// IsVisible -// -// Return PR_TRUE if the whether the component is visible, PR_FALSE otherwise -//------------------------------------------------------------------------- -NS_METHOD nsWindow::IsVisible(PRBool & bState) -{ - bState = mIsVisible && mView && mView->Visible(); - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Hide window borders/decorations for this widget -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::HideWindowChrome(PRBool aShouldHide) -{ - if(mWindowType == eWindowType_child || mWindowType == eWindowType_plugin || - mView == 0 || mView->Window() == 0) - return NS_ERROR_FAILURE; - // B_BORDERED - if (aShouldHide) - mView->Window()->SetLook(B_NO_BORDER_WINDOW_LOOK); - else - mView->Window()->SetLook(mBWindowLook); - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Sanity check potential move coordinates -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY) -{ - if (mIsTopWidgetWindow && mView->Window()) - { - BScreen screen; - // If no valid screen, just return - if (! screen.IsValid()) return NS_OK; - - BRect screen_rect = screen.Frame(); - BRect win_bounds = mView->Window()->Frame(); - -#ifdef DEBUG_CONSTRAIN_POSITION - printf("ConstrainPosition: allowSlop=%s, x=%d, y=%d\n\tScreen :", (aAllowSlop?"T":"F"),*aX,*aY); - screen_rect.PrintToStream(); - printf("\tWindow: "); - win_bounds.PrintToStream(); -#endif - - if (aAllowSlop) - { - if (*aX < kWindowPositionSlop - win_bounds.IntegerWidth() + kWindowBorderWidth) - *aX = kWindowPositionSlop - win_bounds.IntegerWidth() + kWindowBorderWidth; - else if (*aX > screen_rect.IntegerWidth() - kWindowPositionSlop - kWindowBorderWidth) - *aX = screen_rect.IntegerWidth() - kWindowPositionSlop - kWindowBorderWidth; - - if (*aY < kWindowPositionSlop - win_bounds.IntegerHeight() + kWindowTitleBarHeight) - *aY = kWindowPositionSlop - win_bounds.IntegerHeight() + kWindowTitleBarHeight; - else if (*aY > screen_rect.IntegerHeight() - kWindowPositionSlop - kWindowBorderWidth) - *aY = screen_rect.IntegerHeight() - kWindowPositionSlop - kWindowBorderWidth; - - } - else - { - - if (*aX < kWindowBorderWidth) - *aX = kWindowBorderWidth; - else if (*aX > screen_rect.IntegerWidth() - win_bounds.IntegerWidth() - kWindowBorderWidth) - *aX = screen_rect.IntegerWidth() - win_bounds.IntegerWidth() - kWindowBorderWidth; - - if (*aY < kWindowTitleBarHeight) - *aY = kWindowTitleBarHeight; - else if (*aY > screen_rect.IntegerHeight() - win_bounds.IntegerHeight() - kWindowBorderWidth) - *aY = screen_rect.IntegerHeight() - win_bounds.IntegerHeight() - kWindowBorderWidth; - } - } - return NS_OK; -} - -void nsWindow::HideKids(PRBool state) -{ - for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) - { - nsWindow *childWidget = static_cast(kid); - nsRect kidrect = ((nsWindow *)kid)->mBounds; - //Don't bother about invisible - if (mBounds.Intersects(kidrect)) - { - childWidget->Show(!state); - } - } -} - -//------------------------------------------------------------------------- -// -// Move this component -// -//------------------------------------------------------------------------- -nsresult nsWindow::Move(PRInt32 aX, PRInt32 aY) -{ - if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) - SetSizeMode(nsSizeMode_Normal); - - // Only perform this check for non-popup windows, since the positioning can - // in fact change even when the x/y do not. We always need to perform the - // check. See bug #97805 for details. - if (mWindowType != eWindowType_popup && (mBounds.x == aX) && (mBounds.y == aY)) - { - // Nothing to do, since it is already positioned correctly. - return NS_OK; - } - - - // Set cached value for lightweight and printing - mBounds.x = aX; - mBounds.y = aY; - - // We may reset children visibility here, but it needs special care - // - see comment 18 in Bug 311651. More sofisticated code needed. - - // until we lack separate window and widget, we "cannot" move BWindow without BView - if (mView && mView->LockLooper()) - { - if (mView->Parent() || !mView->Window()) - mView->MoveTo(aX, aY); - else - ((nsWindowBeOS *)mView->Window())->MoveTo(aX, aY); - - mView->UnlockLooper(); - } - - OnMove(aX,aY); - - return NS_OK; -} - - - -//------------------------------------------------------------------------- -// -// Resize this component -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint) -{ - - if (aWidth < 0 || aHeight < 0) - return NS_OK; - - mBounds.width = aWidth; - mBounds.height = aHeight; - - // until we lack separate window and widget, we "cannot" resize BWindow without BView - if (mView && mView->LockLooper()) - { - if (mView->Parent() || !mView->Window()) - mView->ResizeTo(aWidth - 1, aHeight - 1); - else - ((nsWindowBeOS *)mView->Window())->ResizeTo(aWidth - 1, aHeight - 1); - - mView->UnlockLooper(); - } - - - OnResize(mBounds); - if (aRepaint) - Update(); - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Resize this component -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Resize(PRInt32 aX, - PRInt32 aY, - PRInt32 aWidth, - PRInt32 aHeight, - PRBool aRepaint) -{ - Move(aX,aY); - Resize(aWidth,aHeight,aRepaint); - return NS_OK; -} - -NS_METHOD nsWindow::SetModal(PRBool aModal) -{ - if(!(mView && mView->Window())) - return NS_ERROR_FAILURE; - if(aModal) - { - window_feel newfeel; - switch(mBWindowFeel) - { - case B_FLOATING_SUBSET_WINDOW_FEEL: - newfeel = B_MODAL_SUBSET_WINDOW_FEEL; - break; - case B_FLOATING_APP_WINDOW_FEEL: - newfeel = B_MODAL_APP_WINDOW_FEEL; - break; - case B_FLOATING_ALL_WINDOW_FEEL: - newfeel = B_MODAL_ALL_WINDOW_FEEL; - break; - default: - return NS_OK; - } - mView->Window()->SetFeel(newfeel); - } - else - { - mView->Window()->SetFeel(mBWindowFeel); - } - return NS_OK; -} -//------------------------------------------------------------------------- -// -// Enable/disable this component -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Enable(PRBool aState) -{ - //TODO: Needs real corect implementation in future - mEnabled = aState; - return NS_OK; -} - - -NS_METHOD nsWindow::IsEnabled(PRBool *aState) -{ - NS_ENSURE_ARG_POINTER(aState); - // looks easy enough, but... - *aState = mEnabled; - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Give the focus to this component -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::SetFocus(PRBool aRaise) -{ - // - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - nsToolkit* toolkit = (nsToolkit *)mToolkit; - if (toolkit && !toolkit->IsGuiThread()) - { - nsCOMPtr widgetProxy; - nsresult rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIWidget), - this, - NS_PROXY_SYNC | NS_PROXY_ALWAYS, - getter_AddRefs(widgetProxy)); - - if (NS_FAILED(rv)) - return rv; - return widgetProxy->SetFocus(aRaise); - } - - // Don't set focus on disabled widgets or popups - if (!mEnabled || eWindowType_popup == mWindowType) - return NS_OK; - - if (mView && mView->LockLooper()) - { - if (mView->Window() && - aRaise && - eWindowType_popup != mWindowType && - !mView->Window()->IsActive() && - gLastActiveWindow != mView->Window()) - mView->Window()->Activate(true); - - mView->MakeFocus(true); - mView->UnlockLooper(); - } - - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Get this component size and position in screen coordinates -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsWindow::GetScreenBounds(nsRect &aRect) -{ - // A window's Frame() value is cached, so locking is not needed - if (mView && mView->Window()) - { - BRect r = mView->Window()->Frame(); - aRect.x = nscoord(r.left); - aRect.y = nscoord(r.top); - aRect.width = r.IntegerWidth()+1; - aRect.height = r.IntegerHeight()+1; - } - else - { - aRect = mBounds; - } - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Set the background/foreground color -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::SetBackgroundColor(const nscolor &aColor) -{ - nsBaseWidget::SetBackgroundColor(aColor); - - // We set the background of toplevel windows so that resizing doesn't show thru - // to Desktop and resizing artifacts. Child windows has transparent background. - if (!mIsTopWidgetWindow) - return NS_OK; - - if (mView && mView->LockLooper()) - { - mView->SetViewColor(NS_GET_R(aColor), NS_GET_G(aColor), NS_GET_B(aColor), NS_GET_A(aColor)); - mView->UnlockLooper(); - } - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Set this component cursor -// -//------------------------------------------------------------------------- - -NS_METHOD nsWindow::SetCursor(nsCursor aCursor) -{ - if (!mView) - return NS_ERROR_FAILURE; - - // Only change cursor if it's changing - if (aCursor != mCursor) - { - BCursor const *newCursor = B_CURSOR_SYSTEM_DEFAULT; - if (be_app->IsCursorHidden()) - be_app->ShowCursor(); - - // Check to see if the array has been loaded, if not, do it. - if (gCursorArray.Length() == 0) - { - gCursorArray.InsertElementAt(0 , new BCursor(cursorHyperlink)); - gCursorArray.InsertElementAt(1 , new BCursor(cursorHorizontalDrag)); - gCursorArray.InsertElementAt(2 , new BCursor(cursorVerticalDrag)); - gCursorArray.InsertElementAt(3 , new BCursor(cursorUpperLeft)); - gCursorArray.InsertElementAt(4 , new BCursor(cursorLowerRight)); - gCursorArray.InsertElementAt(5 , new BCursor(cursorUpperRight)); - gCursorArray.InsertElementAt(6 , new BCursor(cursorLowerLeft)); - gCursorArray.InsertElementAt(7 , new BCursor(cursorCrosshair)); - gCursorArray.InsertElementAt(8 , new BCursor(cursorHelp)); - gCursorArray.InsertElementAt(9 , new BCursor(cursorGrab)); - gCursorArray.InsertElementAt(10, new BCursor(cursorGrabbing)); - gCursorArray.InsertElementAt(11, new BCursor(cursorCopy)); - gCursorArray.InsertElementAt(12, new BCursor(cursorAlias)); - gCursorArray.InsertElementAt(13, new BCursor(cursorWatch2)); - gCursorArray.InsertElementAt(14, new BCursor(cursorCell)); - gCursorArray.InsertElementAt(15, new BCursor(cursorZoomIn)); - gCursorArray.InsertElementAt(16, new BCursor(cursorZoomOut)); - gCursorArray.InsertElementAt(17, new BCursor(cursorLeft)); - gCursorArray.InsertElementAt(18, new BCursor(cursorRight)); - gCursorArray.InsertElementAt(19, new BCursor(cursorTop)); - gCursorArray.InsertElementAt(20, new BCursor(cursorBottom)); - } - - switch (aCursor) - { - case eCursor_standard: - case eCursor_move: - newCursor = B_CURSOR_SYSTEM_DEFAULT; - break; - - case eCursor_select: - newCursor = B_CURSOR_I_BEAM; - break; - - case eCursor_hyperlink: - newCursor = gCursorArray.SafeElementAt(0); - break; - - case eCursor_n_resize: - newCursor = gCursorArray.SafeElementAt(19); - break; - - case eCursor_s_resize: - newCursor = gCursorArray.SafeElementAt(20); - break; - - case eCursor_w_resize: - newCursor = gCursorArray.SafeElementAt(17); - break; - - case eCursor_e_resize: - newCursor = gCursorArray.SafeElementAt(18); - break; - - case eCursor_nw_resize: - newCursor = gCursorArray.SafeElementAt(3); - break; - - case eCursor_se_resize: - newCursor = gCursorArray.SafeElementAt(4); - break; - - case eCursor_ne_resize: - newCursor = gCursorArray.SafeElementAt(5); - break; - - case eCursor_sw_resize: - newCursor = gCursorArray.SafeElementAt(6); - break; - - case eCursor_crosshair: - newCursor = gCursorArray.SafeElementAt(7); - break; - - case eCursor_help: - newCursor = gCursorArray.SafeElementAt(8); - break; - - case eCursor_copy: - newCursor = gCursorArray.SafeElementAt(11); - break; - - case eCursor_alias: - newCursor = gCursorArray.SafeElementAt(12); - break; - - case eCursor_context_menu: - // XXX: No suitable cursor, needs implementing - break; - - case eCursor_cell: - newCursor = gCursorArray.SafeElementAt(14); - break; - - case eCursor_grab: - newCursor = gCursorArray.SafeElementAt(9); - break; - - case eCursor_grabbing: - newCursor = gCursorArray.SafeElementAt(10); - break; - - case eCursor_wait: - case eCursor_spinning: - newCursor = gCursorArray.SafeElementAt(13); - break; - - case eCursor_zoom_in: - newCursor = gCursorArray.SafeElementAt(15); - break; - - case eCursor_zoom_out: - newCursor = gCursorArray.SafeElementAt(16); - break; - - case eCursor_not_allowed: - case eCursor_no_drop: - // XXX: No suitable cursor, needs implementing - break; - - case eCursor_col_resize: - // XXX not 100% appropriate perhaps - newCursor = gCursorArray.SafeElementAt(1); - break; - - case eCursor_row_resize: - // XXX not 100% appropriate perhaps - newCursor = gCursorArray.SafeElementAt(2); - break; - - case eCursor_vertical_text: - // XXX not 100% appropriate perhaps - newCursor = B_CURSOR_I_BEAM; - break; - - case eCursor_all_scroll: - // XXX: No suitable cursor, needs implementing - break; - - case eCursor_nesw_resize: - // XXX not 100% appropriate perhaps - newCursor = gCursorArray.SafeElementAt(1); - break; - - case eCursor_nwse_resize: - // XXX not 100% appropriate perhaps - newCursor = gCursorArray.SafeElementAt(1); - break; - - case eCursor_ns_resize: - newCursor = gCursorArray.SafeElementAt(2); - break; - - case eCursor_ew_resize: - newCursor = gCursorArray.SafeElementAt(1); - break; - - case eCursor_none: - be_app->HideCursor(); - break; - - default: - NS_ERROR("Invalid cursor type"); - break; - } - NS_ASSERTION(newCursor != nsnull, "Cursor not stored in array properly!"); - mCursor = aCursor; - be_app->SetCursor(newCursor, true); - } - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Invalidate this component visible area -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous) -{ - nsresult rv = NS_ERROR_FAILURE; - // Very temporary region for double accounting. - BRegion reg; - reg.MakeEmpty(); - if (mView && mView->LockLooper()) - { - BRect r(aRect.x, - aRect.y, - aRect.x + aRect.width - 1, - aRect.y + aRect.height - 1); - if (PR_TRUE == aIsSynchronous) - { - mView->paintregion.Include(r); - reg.Include(r); - } - else - { - // we use Draw() instead direct addition to paintregion, - // as it sets queue of notification messages for painting. - mView->Draw(r); - rv = NS_OK; - } - mView->UnlockLooper(); - } - // Instant repaint - for given rect only. - // Don't repaint area which isn't marked here for synchronous repaint explicitly. - // BRegion "reg" (equal to aRect) will be substracted from paintregion in OnPaint(). - if (PR_TRUE == aIsSynchronous) - rv = OnPaint(®); - return rv; -} - -//------------------------------------------------------------------------- -// -// Invalidate this component visible area -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsWindow::InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous) -{ - - nsRegionRectSet *rectSet = nsnull; - if (!aRegion) - return NS_ERROR_FAILURE; - nsresult rv = ((nsIRegion *)aRegion)->GetRects(&rectSet); - if (NS_FAILED(rv)) - return rv; - BRegion reg; - reg.MakeEmpty(); - if (mView && mView->LockLooper()) - { - for (PRUint32 i=0; i< rectSet->mRectsLen; ++i) - { - BRect br(rectSet->mRects[i].x, rectSet->mRects[i].y, - rectSet->mRects[i].x + rectSet->mRects[i].width-1, - rectSet->mRects[i].y + rectSet->mRects[i].height -1); - if (PR_TRUE == aIsSynchronous) - { - mView->paintregion.Include(br); - reg.Include(br); - } - else - { - mView->Draw(br); - rv = NS_OK; - } - } - mView->UnlockLooper(); - } - // Instant repaint - for given region only. - // BRegion "reg"(equal to aRegion) will be substracted from paintregion in OnPaint(). - if (PR_TRUE == aIsSynchronous) - rv = OnPaint(®); - - return rv; -} - -//------------------------------------------------------------------------- -// -// Force a synchronous repaint of the window -// -//------------------------------------------------------------------------- -NS_IMETHODIMP nsWindow::Update() -{ - nsresult rv = NS_ERROR_FAILURE; - //Switching scrolling trigger off - mIsScrolling = PR_FALSE; - if (mWindowType == eWindowType_child || mWindowType == eWindowType_plugin) - return NS_OK; - BRegion reg; - reg.MakeEmpty(); - if(mView && mView->LockLooper()) - { - //Flushing native pending updates if any - if (mView->Window()) - mView->Window()->UpdateIfNeeded(); - // Let app_server to invalidate - mView->Invalidate(); - bool nonempty = mView->GetPaintRegion(®); - mView->UnlockLooper(); - // Look if native update calls above filled update region and paint it - if (nonempty) - rv = OnPaint(®); - } - return rv; -} - -//------------------------------------------------------------------------- -// -// Return some native data according to aDataType -// -//------------------------------------------------------------------------- -void* nsWindow::GetNativeData(PRUint32 aDataType) -{ - if (!mView) - return NULL; - switch(aDataType) - { - case NS_NATIVE_WINDOW: - return (void *)(mView->Window()); - case NS_NATIVE_WIDGET: - case NS_NATIVE_PLUGIN_PORT: - return (void *)((nsViewBeOS *)mView); - case NS_NATIVE_GRAPHIC: - return (void *)((BView *)mView); - case NS_NATIVE_COLORMAP: - default: - break; - } - return NULL; -} - -//------------------------------------------------------------------------- -// -// Set the colormap of the window -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::SetColorMap(nsColorMap *aColorMap) -{ - NS_WARNING("nsWindow::SetColorMap - not implemented"); - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Scroll the bits of a window -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) -{ - // Switching trigger on - mIsScrolling = PR_TRUE; - //Preventing main view invalidation loop-chain when children are moving - //by by hiding children nsWidgets. - //Children will be unhidden in ::Update() when called by other than gkview::Scroll() method. - HideKids(PR_TRUE); - if (mView && mView->LockLooper()) - { - // Kill any attempt to invalidate until scroll is finished - mView->SetVisible(false); - - BRect src; - BRect b = mView->Bounds(); - - if (aClipRect) - { - src.left = aClipRect->x; - src.top = aClipRect->y; - src.right = aClipRect->XMost() - 1; - src.bottom = aClipRect->YMost() - 1; - } - else - { - src = b; - } - // Restricting source by on-screen part of BView - if (mView->Window()) - { - BRect screenframe = mView->ConvertFromScreen(BScreen(mView->Window()).Frame()); - src = src & screenframe; - if (mView->Parent()) - { - BRect parentframe = mView->ConvertFromParent(mView->Parent()->Frame()); - src = src & parentframe; - } - } - - BRegion invalid; - invalid.Include(src); - // Next source clipping check, for same level siblings - if ( BView *v = mView->Parent() ) - { - for (BView *child = v->ChildAt(0); child; child = child->NextSibling() ) - { - BRect siblingframe = mView->ConvertFromParent(child->Frame()); - if (child != mView && child->Parent() != mView) - { - invalid.Exclude(siblingframe); - mView->paintregion.Exclude(siblingframe); - } - } - src = invalid.Frame(); - } - - // make sure we only reference visible bits - // so we don't trigger a BView invalidate - - if (src.left + aDx < 0) - src.left = -aDx; - if (src.right + aDx > b.right) - src.right = b.right - aDx; - if (src.top + aDy < 0) - src.top = -aDy; - if (src.bottom + aDy > b.bottom) - src.bottom = b.bottom - aDy; - - BRect dest = src.OffsetByCopy(aDx, aDy); - mView->ConstrainClippingRegion(&invalid); - // Moving visible content - if (src.IsValid() && dest.IsValid()) - mView->CopyBits(src, dest); - - invalid.Exclude(dest); - // Native paintregion needs shifting too, it is very important action - // (as app_server doesn't know about Mozilla viewmanager tricks) - - // it allows proper update after scroll for areas covered by other windows. - mView->paintregion.OffsetBy(aDx, aDy); - mView->ConstrainClippingRegion(&invalid); - // Time to silently move now invisible children - for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) - { - nsWindow *childWidget = static_cast(kid); - // No need to Lock/UnlockLooper with GetBounds() and Move() methods - // using cached values and native MoveBy() instead - nsRect bounds = childWidget->mBounds; - bounds.x += aDx; - bounds.y += aDy; - childWidget->Move(bounds.x, bounds.y); - BView *child = ((BView *)kid->GetNativeData(NS_NATIVE_WIDGET)); - if (child) - mView->paintregion.Exclude(child->Frame()); - } - - // Painting calculated region now, - // letting Update() to paint remaining content of paintregion - OnPaint(&invalid); - HideKids(PR_FALSE); - // re-allow updates - mView->SetVisible(true); - mView->UnlockLooper(); - } - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// Every function that needs a thread switch goes through this function -// by calling SendMessage (..WM_CALLMETHOD..) in nsToolkit::CallMethod. -// -//------------------------------------------------------------------------- -bool nsWindow::CallMethod(MethodInfo *info) -{ - bool bRet = TRUE; - - switch (info->methodId) - { - case nsSwitchToUIThread::CLOSEWINDOW : - { - NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod"); - if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType && - eWindowType_plugin != mWindowType) - DealWithPopups(nsSwitchToUIThread::CLOSEWINDOW,nsPoint(0,0)); - - // Bit more Kung-fu. We do care ourselves about children destroy notofication. - // Including those floating dialogs we added to Gecko hierarchy in StandardWindowCreate() - - for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) - { - nsWindow *childWidget = static_cast(kid); - BWindow* kidwindow = (BWindow *)kid->GetNativeData(NS_NATIVE_WINDOW); - if (kidwindow) - { - // PostMessage() is unsafe, so using BMessenger - BMessenger bm(kidwindow); - bm.SendMessage(B_QUIT_REQUESTED); - } - } - DispatchStandardEvent(NS_DESTROY); - } - break; - -#ifdef DEBUG_FOCUS - case nsSwitchToUIThread::GOT_FOCUS: - NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod"); - if (!mEnabled) - return false; - if ((uint32)info->args[0] != (uint32)mView) - printf("Wrong view to get focus\n");*/ - break; -#endif - case nsSwitchToUIThread::KILL_FOCUS: -#ifdef DEBUG_FOCUS - else - printf("Wrong view to de-focus\n"); -#endif -#if defined BeIME - nsIMEBeOS::GetIME()->DispatchCancelIME(); - if (mView && mView->LockLooper()) - { - mView->SetFlags(mView->Flags() & ~B_NAVIGABLE); - mView->UnlockLooper(); - } -#endif - break; - - case nsSwitchToUIThread::BTNCLICK : - { - NS_ASSERTION(info->nArgs == 6, "Wrong number of arguments to CallMethod"); - if (!mEnabled) - return false; - // close popup when clicked outside of the popup window - uint32 eventID = ((int32 *)info->args)[0]; - PRBool rollup = PR_FALSE; - - if (eventID == NS_MOUSE_BUTTON_DOWN && - mView && mView->LockLooper()) - { - BPoint p(((int32 *)info->args)[1], ((int32 *)info->args)[2]); - mView->ConvertToScreen(&p); - rollup = DealWithPopups(nsSwitchToUIThread::ONMOUSE, nsPoint(p.x, p.y)); - mView->UnlockLooper(); - } - // Drop click event - bug 314330 - if (rollup) - return false; - DispatchMouseEvent(((int32 *)info->args)[0], - nsPoint(((int32 *)info->args)[1], ((int32 *)info->args)[2]), - ((int32 *)info->args)[3], - ((int32 *)info->args)[4], - ((int32 *)info->args)[5]); - - if (((int32 *)info->args)[0] == NS_MOUSE_BUTTON_DOWN && - ((int32 *)info->args)[5] == nsMouseEvent::eRightButton) - { - DispatchMouseEvent (NS_CONTEXTMENU, - nsPoint(((int32 *)info->args)[1], ((int32 *)info->args)[2]), - ((int32 *)info->args)[3], - ((int32 *)info->args)[4], - ((int32 *)info->args)[5]); - } - } - break; - - case nsSwitchToUIThread::ONWHEEL : - { - NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod"); - // avoid mistargeting - if ((uint32)info->args[0] != (uint32)mView) - return false; - BPoint cursor(0,0); - uint32 buttons; - BPoint delta; - if (mView && mView->LockLooper()) - { - mView->GetMouse(&cursor, &buttons, false); - delta = mView->GetWheel(); - mView->UnlockLooper(); - } - else - return false; - // BeOS TwoWheel input-filter is bit buggy atm, generating sometimes X-wheel with no reason, - // so we're setting priority for Y-wheel. - // Also hardcoding here _system_ scroll-step value to 3 lines. - if (nscoord(delta.y) != 0) - { - OnWheel(nsMouseScrollEvent::kIsVertical, buttons, cursor, nscoord(delta.y)*3); - } - else if(nscoord(delta.x) != 0) - OnWheel(nsMouseScrollEvent::kIsHorizontal, buttons, cursor, nscoord(delta.x)*3); - } - break; - - case nsSwitchToUIThread::ONKEY : - NS_ASSERTION(info->nArgs == 6, "Wrong number of arguments to CallMethod"); - if (((int32 *)info->args)[0] == NS_KEY_DOWN) - { - OnKeyDown(((int32 *)info->args)[0], - (const char *)(&((uint32 *)info->args)[1]), ((int32 *)info->args)[2], - ((uint32 *)info->args)[3], ((uint32 *)info->args)[4], ((int32 *)info->args)[5]); - } - else - { - if (((int32 *)info->args)[0] == NS_KEY_UP) - { - OnKeyUp(((int32 *)info->args)[0], - (const char *)(&((uint32 *)info->args)[1]), ((int32 *)info->args)[2], - ((uint32 *)info->args)[3], ((uint32 *)info->args)[4], ((int32 *)info->args)[5]); - } - } - break; - - case nsSwitchToUIThread::ONPAINT : - NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod"); - { - if ((uint32)mView != ((uint32 *)info->args)[0]) - return false; - BRegion reg; - reg.MakeEmpty(); - if(mView && mView->LockLooper()) - { - bool nonempty = mView->GetPaintRegion(®); - mView->UnlockLooper(); - if (nonempty) - OnPaint(®); - } - } - break; - - case nsSwitchToUIThread::ONRESIZE : - { - NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod"); - if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType && - eWindowType_plugin != mWindowType) - DealWithPopups(nsSwitchToUIThread::ONRESIZE,nsPoint(0,0)); - // This should be called only from BWindow::FrameResized() - if (!mIsTopWidgetWindow || !mView || !mView->Window()) - return false; - - nsRect r(mBounds); - if (mView->LockLooper()) - { - BRect br = mView->Frame(); - r.x = nscoord(br.left); - r.y = nscoord(br.top); - r.width = br.IntegerWidth() + 1; - r.height = br.IntegerHeight() + 1; - ((nsWindowBeOS *)mView->Window())->fJustGotBounds = true; - mView->UnlockLooper(); - } - OnResize(r); - } - break; - - case nsSwitchToUIThread::ONMOUSE : - { - NS_ASSERTION(info->nArgs == 4, "Wrong number of arguments to CallMethod"); - if (!mEnabled) - return false; - DispatchMouseEvent(((int32 *)info->args)[0], - nsPoint(((int32 *)info->args)[1], ((int32 *)info->args)[2]), - 0, - ((int32 *)info->args)[3]); - } - break; - - case nsSwitchToUIThread::ONDROP : - { - NS_ASSERTION(info->nArgs == 4, "Wrong number of arguments to CallMethod"); - - nsDragEvent event(PR_TRUE, (int32) info->args[0], this); - nsPoint point(((int32 *)info->args)[1], ((int32 *)info->args)[2]); - InitEvent (event, &point); - uint32 mod = (uint32) info->args[3]; - event.isShift = mod & B_SHIFT_KEY; - event.isControl = mod & B_CONTROL_KEY; - event.isAlt = mod & B_COMMAND_KEY; - event.isMeta = mod & B_OPTION_KEY; - - // Setting drag action, must be done before event dispatch - nsCOMPtr dragService = do_GetService(kCDragServiceCID); - if (dragService) - { - nsCOMPtr dragSession; - dragService->GetCurrentSession(getter_AddRefs(dragSession)); - if (dragSession) - { - // Original action mask stored in dragsession. - // For native events such mask must be set in nsDragServiceBeOS::UpdateDragMessageIfNeeded() - - PRUint32 action_mask = 0; - dragSession->GetDragAction(&action_mask); - PRUint32 action = nsIDragService::DRAGDROP_ACTION_MOVE; - if (mod & B_OPTION_KEY) - { - if (mod & B_COMMAND_KEY) - action = nsIDragService::DRAGDROP_ACTION_LINK & action_mask; - else - action = nsIDragService::DRAGDROP_ACTION_COPY & action_mask; - } - dragSession->SetDragAction(action); - } - } - DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - - if (dragService) - dragService->EndDragSession(PR_TRUE); - } - break; - - case nsSwitchToUIThread::ONACTIVATE: - NS_ASSERTION(info->nArgs == 2, "Wrong number of arguments to CallMethod"); - if (!mEnabled || eWindowType_popup == mWindowType || 0 == mView->Window()) - return false; - if ((BWindow *)info->args[1] != mView->Window()) - return false; - if (mEventCallback || eWindowType_child == mWindowType || - eWindowType_plugin == mWindowType) - { - bool active = (bool)info->args[0]; - if (!active) - { - if (eWindowType_dialog == mWindowType || - eWindowType_toplevel == mWindowType) - DealWithPopups(nsSwitchToUIThread::ONACTIVATE,nsPoint(0,0)); - //Testing if BWindow is really deactivated. - if (!mView->Window()->IsActive()) - { - // BeOS is poor in windows hierarchy and variations support. In lot of aspects. - // Here is workaround for flacky Activate() handling for B_FLOATING windows. - // We should force parent (de)activation to allow main window to regain control after closing floating dialog. - if (mWindowParent && mView->Window()->IsFloating()) - mWindowParent->DispatchFocus(NS_ACTIVATE); - - DispatchFocus(NS_DEACTIVATE); -#if defined(BeIME) - nsIMEBeOS::GetIME()->DispatchCancelIME(); -#endif - } - } - else - { - - if (mView->Window()->IsActive()) - { - // See comment above. - if (mWindowParent && mView->Window()->IsFloating()) - mWindowParent->DispatchFocus(NS_DEACTIVATE); - - DispatchFocus(NS_ACTIVATE); - if (mView && mView->Window()) - gLastActiveWindow = mView->Window(); - } - } - } - break; - - case nsSwitchToUIThread::ONMOVE: - { - NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod"); - nsRect r; - // We use this only for tracking whole window moves - GetScreenBounds(r); - if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType && - eWindowType_plugin != mWindowType) - DealWithPopups(nsSwitchToUIThread::ONMOVE,nsPoint(0,0)); - OnMove(r.x, r.y); - } - break; - - case nsSwitchToUIThread::ONWORKSPACE: - { - NS_ASSERTION(info->nArgs == 2, "Wrong number of arguments to CallMethod"); - if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType && - eWindowType_plugin != mWindowType) - DealWithPopups(nsSwitchToUIThread::ONWORKSPACE,nsPoint(0,0)); - } - break; - -#if defined(BeIME) - case nsSwitchToUIThread::ONIME: - //No assertion used, as number of arguments varies here - if (mView && mView->LockLooper()) - { - mView->SetFlags(mView->Flags() | B_NAVIGABLE); - mView->UnlockLooper(); - } - nsIMEBeOS::GetIME()->RunIME(info->args, this, mView); - break; -#endif - default: - bRet = FALSE; - break; - - } - - return bRet; -} - -//------------------------------------------------------------------------- -// -// Key code translation related data -// -//------------------------------------------------------------------------- - -struct nsKeyConverter { - int vkCode; // Platform independent key code - char bekeycode; // BeOS key code -}; - -// -// Netscape keycodes are defined in widget/public/nsGUIEvent.h -// BeOS keycodes can be viewd at -// http://www.be.com/documentation/be_book/Keyboard/KeyboardKeyCodes.html -// - -struct nsKeyConverter nsKeycodesBeOS[] = { - // { NS_VK_CANCEL, GDK_Cancel }, - { NS_VK_BACK, 0x1e }, - { NS_VK_TAB, 0x26 }, - // { NS_VK_TAB, GDK_ISO_Left_Tab }, - // { NS_VK_CLEAR, GDK_Clear }, - { NS_VK_RETURN, 0x47 }, - { NS_VK_SHIFT, 0x4b }, - { NS_VK_SHIFT, 0x56 }, - { NS_VK_CONTROL, 0x5c }, - { NS_VK_CONTROL, 0x60 }, - { NS_VK_ALT, 0x5d }, - { NS_VK_ALT, 0x5f }, - { NS_VK_PAUSE, 0x22 }, - { NS_VK_CAPS_LOCK, 0x3b }, - { NS_VK_ESCAPE, 0x1 }, - { NS_VK_SPACE, 0x5e }, - { NS_VK_PAGE_UP, 0x21 }, - { NS_VK_PAGE_DOWN, 0x36 }, - { NS_VK_END, 0x35 }, - { NS_VK_HOME, 0x20 }, - { NS_VK_LEFT, 0x61 }, - { NS_VK_UP, 0x57 }, - { NS_VK_RIGHT, 0x63 }, - { NS_VK_DOWN, 0x62 }, - { NS_VK_PRINTSCREEN, 0xe }, - { NS_VK_INSERT, 0x1f }, - { NS_VK_DELETE, 0x34 }, - - // The "Windows Key" - { NS_VK_META, 0x66 }, - { NS_VK_META, 0x67 }, - - // keypad keys (constant keys) - { NS_VK_MULTIPLY, 0x24 }, - { NS_VK_ADD, 0x3a }, - // { NS_VK_SEPARATOR, }, ??? - { NS_VK_SUBTRACT, 0x25 }, - { NS_VK_DIVIDE, 0x23 }, - { NS_VK_RETURN, 0x5b }, - - { NS_VK_COMMA, 0x53 }, - { NS_VK_PERIOD, 0x54 }, - { NS_VK_SLASH, 0x55 }, - { NS_VK_BACK_SLASH, 0x33 }, - { NS_VK_BACK_SLASH, 0x6a }, // got this code on japanese keyboard - { NS_VK_BACK_SLASH, 0x6b }, // got this code on japanese keyboard - { NS_VK_BACK_QUOTE, 0x11 }, - { NS_VK_OPEN_BRACKET, 0x31 }, - { NS_VK_CLOSE_BRACKET, 0x32 }, - { NS_VK_SEMICOLON, 0x45 }, - { NS_VK_QUOTE, 0x46 }, - - // NS doesn't have dash or equals distinct from the numeric keypad ones, - // so we'll use those for now. See bug 17008: - { NS_VK_SUBTRACT, 0x1c }, - { NS_VK_EQUALS, 0x1d }, - - { NS_VK_F1, B_F1_KEY }, - { NS_VK_F2, B_F2_KEY }, - { NS_VK_F3, B_F3_KEY }, - { NS_VK_F4, B_F4_KEY }, - { NS_VK_F5, B_F5_KEY }, - { NS_VK_F6, B_F6_KEY }, - { NS_VK_F7, B_F7_KEY }, - { NS_VK_F8, B_F8_KEY }, - { NS_VK_F9, B_F9_KEY }, - { NS_VK_F10, B_F10_KEY }, - { NS_VK_F11, B_F11_KEY }, - { NS_VK_F12, B_F12_KEY }, - - { NS_VK_1, 0x12 }, - { NS_VK_2, 0x13 }, - { NS_VK_3, 0x14 }, - { NS_VK_4, 0x15 }, - { NS_VK_5, 0x16 }, - { NS_VK_6, 0x17 }, - { NS_VK_7, 0x18 }, - { NS_VK_8, 0x19 }, - { NS_VK_9, 0x1a }, - { NS_VK_0, 0x1b }, - - { NS_VK_A, 0x3c }, - { NS_VK_B, 0x50 }, - { NS_VK_C, 0x4e }, - { NS_VK_D, 0x3e }, - { NS_VK_E, 0x29 }, - { NS_VK_F, 0x3f }, - { NS_VK_G, 0x40 }, - { NS_VK_H, 0x41 }, - { NS_VK_I, 0x2e }, - { NS_VK_J, 0x42 }, - { NS_VK_K, 0x43 }, - { NS_VK_L, 0x44 }, - { NS_VK_M, 0x52 }, - { NS_VK_N, 0x51 }, - { NS_VK_O, 0x2f }, - { NS_VK_P, 0x30 }, - { NS_VK_Q, 0x27 }, - { NS_VK_R, 0x2a }, - { NS_VK_S, 0x3d }, - { NS_VK_T, 0x2b }, - { NS_VK_U, 0x2d }, - { NS_VK_V, 0x4f }, - { NS_VK_W, 0x28 }, - { NS_VK_X, 0x4d }, - { NS_VK_Y, 0x2c }, - { NS_VK_Z, 0x4c } - }; - -// keycode of keypad when num-locked -struct nsKeyConverter nsKeycodesBeOSNumLock[] = { - { NS_VK_NUMPAD0, 0x64 }, - { NS_VK_NUMPAD1, 0x58 }, - { NS_VK_NUMPAD2, 0x59 }, - { NS_VK_NUMPAD3, 0x5a }, - { NS_VK_NUMPAD4, 0x48 }, - { NS_VK_NUMPAD5, 0x49 }, - { NS_VK_NUMPAD6, 0x4a }, - { NS_VK_NUMPAD7, 0x37 }, - { NS_VK_NUMPAD8, 0x38 }, - { NS_VK_NUMPAD9, 0x39 }, - { NS_VK_DECIMAL, 0x65 } - }; - -// keycode of keypad when not num-locked -struct nsKeyConverter nsKeycodesBeOSNoNumLock[] = { - { NS_VK_LEFT, 0x48 }, - { NS_VK_RIGHT, 0x4a }, - { NS_VK_UP, 0x38 }, - { NS_VK_DOWN, 0x59 }, - { NS_VK_PAGE_UP, 0x39 }, - { NS_VK_PAGE_DOWN, 0x5a }, - { NS_VK_HOME, 0x37 }, - { NS_VK_END, 0x58 }, - { NS_VK_INSERT, 0x64 }, - { NS_VK_DELETE, 0x65 } - }; - -//------------------------------------------------------------------------- -// -// Translate key code -// Input is BeOS keyboard key-code; output is in NS_VK format -// -//------------------------------------------------------------------------- - -static int TranslateBeOSKeyCode(int32 bekeycode, bool isnumlock) -{ -#ifdef KB_DEBUG - printf("TranslateBeOSKeyCode: bekeycode = 0x%x\n",bekeycode); -#endif - int i; - int length = sizeof(nsKeycodesBeOS) / sizeof(struct nsKeyConverter); - int length_numlock = sizeof(nsKeycodesBeOSNumLock) / sizeof(struct nsKeyConverter); - int length_nonumlock = sizeof(nsKeycodesBeOSNoNumLock) / sizeof(struct nsKeyConverter); - - // key code conversion - for (i = 0; i < length; i++) - { - if (nsKeycodesBeOS[i].bekeycode == bekeycode) - return(nsKeycodesBeOS[i].vkCode); - } - // numpad keycode vary with numlock - if (isnumlock) - { - for (i = 0; i < length_numlock; i++) - { - if (nsKeycodesBeOSNumLock[i].bekeycode == bekeycode) - return(nsKeycodesBeOSNumLock[i].vkCode); - } - } - else - { - for (i = 0; i < length_nonumlock; i++) - { - if (nsKeycodesBeOSNoNumLock[i].bekeycode == bekeycode) - return(nsKeycodesBeOSNoNumLock[i].vkCode); - } - } -#ifdef KB_DEBUG - printf("TranslateBeOSKeyCode: ####### Translation not Found #######\n"); -#endif - return((int)0); -} - -//------------------------------------------------------------------------- -// -// OnKeyDown -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnKeyDown(PRUint32 aEventType, const char *bytes, - int32 numBytes, PRUint32 mod, PRUint32 bekeycode, int32 rawcode) -{ - PRUint32 aTranslatedKeyCode; - PRBool noDefault = PR_FALSE; - - mIsShiftDown = (mod & B_SHIFT_KEY) ? PR_TRUE : PR_FALSE; - mIsControlDown = (mod & B_CONTROL_KEY) ? PR_TRUE : PR_FALSE; - mIsAltDown = ((mod & B_COMMAND_KEY) && !(mod & B_RIGHT_OPTION_KEY))? PR_TRUE : PR_FALSE; - mIsMetaDown = (mod & B_LEFT_OPTION_KEY) ? PR_TRUE : PR_FALSE; - bool IsNumLocked = ((mod & B_NUM_LOCK) != 0); - - aTranslatedKeyCode = TranslateBeOSKeyCode(bekeycode, IsNumLocked); - - if (numBytes <= 1) - { - noDefault = DispatchKeyEvent(NS_KEY_DOWN, 0, aTranslatedKeyCode); - } - else - { - // non ASCII chars - } - - // ------------ On Char ------------ - PRUint32 uniChar; - - if ((mIsControlDown || mIsAltDown || mIsMetaDown) && rawcode >= 'a' && rawcode <= 'z') - { - if (mIsShiftDown) - uniChar = rawcode + 'A' - 'a'; - else - uniChar = rawcode; - aTranslatedKeyCode = 0; - } - else - { - if (numBytes == 0) // deal with unmapped key - return noDefault; - - switch((unsigned char)bytes[0]) - { - case 0xc8://System Request - case 0xca://Break - return noDefault;// do not send 'KEY_PRESS' message - - case B_INSERT: - case B_ESCAPE: - case B_FUNCTION_KEY: - case B_HOME: - case B_PAGE_UP: - case B_END: - case B_PAGE_DOWN: - case B_UP_ARROW: - case B_LEFT_ARROW: - case B_DOWN_ARROW: - case B_RIGHT_ARROW: - case B_TAB: - case B_DELETE: - case B_BACKSPACE: - case B_ENTER: - uniChar = 0; - break; - - default: - // UTF-8 to unicode conversion - if (numBytes >= 1 && (bytes[0] & 0x80) == 0) - { - // 1 byte utf-8 char - uniChar = bytes[0]; - } - else - { - if (numBytes >= 2 && (bytes[0] & 0xe0) == 0xc0) - { - // 2 byte utf-8 char - uniChar = ((uint16)(bytes[0] & 0x1f) << 6) | (uint16)(bytes[1] & 0x3f); - } - else - { - if (numBytes >= 3 && (bytes[0] & 0xf0) == 0xe0) - { - // 3 byte utf-8 char - uniChar = ((uint16)(bytes[0] & 0x0f) << 12) | ((uint16)(bytes[1] & 0x3f) << 6) - | (uint16)(bytes[2] & 0x3f); - } - else - { - //error - uniChar = 0; - NS_WARNING("nsWindow::OnKeyDown() error: bytes[] has not enough chars."); - } - } - } - aTranslatedKeyCode = 0; - break; - } - } - - // If prevent default set for onkeydown, do the same for onkeypress - PRUint32 extraFlags = (noDefault ? NS_EVENT_FLAG_NO_DEFAULT : 0); - return DispatchKeyEvent(NS_KEY_PRESS, uniChar, aTranslatedKeyCode, extraFlags) && noDefault; -} - -//------------------------------------------------------------------------- -// -// OnKeyUp -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnKeyUp(PRUint32 aEventType, const char *bytes, - int32 numBytes, PRUint32 mod, PRUint32 bekeycode, int32 rawcode) -{ - PRUint32 aTranslatedKeyCode; - bool IsNumLocked = ((mod & B_NUM_LOCK) != 0); - - mIsShiftDown = (mod & B_SHIFT_KEY) ? PR_TRUE : PR_FALSE; - mIsControlDown = (mod & B_CONTROL_KEY) ? PR_TRUE : PR_FALSE; - mIsAltDown = ((mod & B_COMMAND_KEY) && !(mod & B_RIGHT_OPTION_KEY))? PR_TRUE : PR_FALSE; - mIsMetaDown = (mod & B_LEFT_OPTION_KEY) ? PR_TRUE : PR_FALSE; - - aTranslatedKeyCode = TranslateBeOSKeyCode(bekeycode, IsNumLocked); - - PRBool result = DispatchKeyEvent(NS_KEY_UP, 0, aTranslatedKeyCode); - return result; - -} - -//------------------------------------------------------------------------- -// -// DispatchKeyEvent -// -//------------------------------------------------------------------------- - -PRBool nsWindow::DispatchKeyEvent(PRUint32 aEventType, PRUint32 aCharCode, - PRUint32 aKeyCode, PRUint32 aFlags) -{ - nsKeyEvent event(PR_TRUE, aEventType, this); - nsPoint point; - - point.x = 0; - point.y = 0; - - InitEvent(event, &point); // this add ref's event.widget - - event.flags |= aFlags; - event.charCode = aCharCode; - event.keyCode = aKeyCode; - -#ifdef KB_DEBUG - static int cnt=0; - printf("%d DispatchKE Type: %s charCode 0x%x keyCode 0x%x ", cnt++, - (NS_KEY_PRESS == aEventType)?"PRESS":(aEventType == NS_KEY_UP?"Up":"Down"), - event.charCode, event.keyCode); - printf("Shift: %s Control %s Alt: %s Meta: %s\n", - (mIsShiftDown?"D":"U"), - (mIsControlDown?"D":"U"), - (mIsAltDown?"D":"U"), - (mIsMetaDown?"D":"U")); -#endif - - event.isShift = mIsShiftDown; - event.isControl = mIsControlDown; - event.isMeta = mIsMetaDown; - event.isAlt = mIsAltDown; - - PRBool result = DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - - return result; -} - -//------------------------------------------------------------------------- -// -// WM_DESTROY has been called -// -//------------------------------------------------------------------------- -void nsWindow::OnDestroy() -{ - mOnDestroyCalled = PR_TRUE; - - // release references to children, device context, toolkit, and app shell - nsBaseWidget::OnDestroy(); - - // dispatch the event - if (!mIsDestroying) - { - // dispatching of the event may cause the reference count to drop to 0 - // and result in this object being destroyed. To avoid that, add a reference - // and then release it after dispatching the event - AddRef(); - DispatchStandardEvent(NS_DESTROY); - Release(); - } -} - -//------------------------------------------------------------------------- -// -// Move -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnMove(PRInt32 aX, PRInt32 aY) -{ - nsGUIEvent event(PR_TRUE, NS_MOVE, this); - InitEvent(event); - event.refPoint.x = aX; - event.refPoint.y = aY; - - PRBool result = DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - return result; -} - -void nsWindow::OnWheel(PRInt32 aDirection, uint32 aButtons, BPoint aPoint, nscoord aDelta) -{ - // we don't use the mIsXDown bools because - // they get reset on Gecko reload (makes it harder - // to use stuff like Alt+Wheel) - - nsMouseScrollEvent scrollEvent(PR_TRUE, NS_MOUSE_SCROLL, this); - uint32 mod (modifiers()); - scrollEvent.isControl = mod & B_CONTROL_KEY; - scrollEvent.isShift = mod & B_SHIFT_KEY; - scrollEvent.isAlt = mod & B_COMMAND_KEY; - scrollEvent.isMeta = mod & B_OPTION_KEY; - - scrollEvent.scrollFlags = aDirection; - scrollEvent.delta = aDelta; - scrollEvent.time = PR_IntervalNow(); - scrollEvent.refPoint.x = nscoord(aPoint.x); - scrollEvent.refPoint.y = nscoord(aPoint.y); - - nsEventStatus rv; - DispatchEvent (&scrollEvent, rv); -} - -//------------------------------------------------------------------------- -// -// Paint -// -//------------------------------------------------------------------------- -nsresult nsWindow::OnPaint(BRegion *breg) -{ - nsresult rv = NS_ERROR_FAILURE; - if (mView && mView->LockLooper()) - { - // Substracting area from paintregion - mView->Validate(breg); - // looks like it should be done by Mozilla via nsRenderingContext methods, - // but we saw in some cases how it follows Win32 ideas and don't care about clipping there - mView->ConstrainClippingRegion(breg); - mView->UnlockLooper(); - } - else - return rv; - BRect br = breg->Frame(); - if (!br.IsValid() || !mEventCallback || !mView || - (eWindowType_child != mWindowType && eWindowType_popup != mWindowType && - eWindowType_plugin != mWindowType)) - return rv; - nsRect nsr(nscoord(br.left), nscoord(br.top), - nscoord(br.IntegerWidth() + 1), nscoord(br.IntegerHeight() + 1)); - mUpdateArea->SetTo(0,0,0,0); - int numrects = breg->CountRects(); - for (int i = 0; i< numrects; i++) - { - BRect br = breg->RectAt(i); - mUpdateArea->Union(int(br.left), int(br.top), - br.IntegerWidth() + 1, br.IntegerHeight() + 1); - } - - nsIRenderingContext* rc = GetRenderingContext(); - if (NS_UNLIKELY(!rc)) { - return NS_ERROR_FAILURE; - } - - // Double buffering for cairo builds is done here - nsRefPtr ctx = rc->ThebesContext(); - ctx->Save(); - - // Clip - ctx->NewPath(); - for (int i = 0; i< numrects; i++) - { - BRect br = breg->RectAt(i); - ctx->Rectangle(gfxRect(int(br.left), int(br.top), - br.IntegerWidth() + 1, br.IntegerHeight() + 1)); - } - ctx->Clip(); - - // double buffer - ctx->PushGroup(gfxContext::CONTENT_COLOR); - - nsPaintEvent event(PR_TRUE, NS_PAINT, this); - - InitEvent(event); - event.region = mUpdateArea; - event.rect = &nsr; - event.renderingContext = rc; - if (event.renderingContext != nsnull) - { - // TODO: supply nsRenderingContextBeOS with font, colors and other state variables here. - // It will help toget rid of some hacks in LockAndUpdateView and - // allow non-permanent nsDrawingSurface for BeOS - currently it fails for non-bitmapped BViews/widgets. - // Something like this: - //if (mFontMetrics) - // event.renderingContext->SetFont(mFontMetrics); - rv = DispatchWindowEvent(&event) ? NS_OK : NS_ERROR_FAILURE; - NS_RELEASE(event.renderingContext); - } - - NS_RELEASE(event.widget); - - // The second half of double buffering - if (rv == NS_OK) { - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - ctx->PopGroupToSource(); - ctx->Paint(); - } else { - // ignore - ctx->PopGroup(); - } - - ctx->Restore(); - - return rv; -} - - -//------------------------------------------------------------------------- -// -// Send a resize message to the listener -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnResize(nsRect &aWindowRect) -{ - // call the event callback - if (mEventCallback) - { - nsSizeEvent event(PR_TRUE, NS_SIZE, this); - InitEvent(event); - event.windowSize = &aWindowRect; - // We have same size for windows rect and "client area" rect - event.mWinWidth = aWindowRect.width; - event.mWinHeight = aWindowRect.height; - PRBool result = DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - return result; - } - return PR_FALSE; -} - - - -//------------------------------------------------------------------------- -// -// Deal with all sort of mouse event -// -//------------------------------------------------------------------------- -PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, nsPoint aPoint, PRUint32 clicks, PRUint32 mod, - PRUint16 aButton) -{ - PRBool result = PR_FALSE; - if (nsnull != mEventCallback) - { - nsMouseEvent event(PR_TRUE, aEventType, this, nsMouseEvent::eReal); - InitEvent (event, &aPoint); - event.isShift = mod & B_SHIFT_KEY; - event.isControl = mod & B_CONTROL_KEY; - event.isAlt = mod & B_COMMAND_KEY; - event.isMeta = mod & B_OPTION_KEY; - event.clickCount = clicks; - event.button = aButton; - - // call the event callback - result = DispatchWindowEvent(&event); - NS_RELEASE(event.widget); - return result; - } - - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// Deal with focus messages -// -//------------------------------------------------------------------------- -PRBool nsWindow::DispatchFocus(PRUint32 aEventType) -{ - // call the event callback - if (mEventCallback) - return(DispatchStandardEvent(aEventType)); - - return PR_FALSE; -} - -NS_METHOD nsWindow::SetTitle(const nsAString& aTitle) -{ - if (mView && mView->LockLooper()) - { - mView->Window()->SetTitle(NS_ConvertUTF16toUTF8(aTitle).get()); - mView->UnlockLooper(); - } - return NS_OK; -} - -//---------------------------------------------------- -// Special Sub-Class -//---------------------------------------------------- -nsIWidgetStore::nsIWidgetStore( nsIWidget *aWidget ) - : mWidget( aWidget ) -{ - // NS_ADDREF/NS_RELEASE is not needed here. - // This class is used as internal (BeOS native) object of nsWindow, - // so it must not addref/release nsWindow here. - // Otherwise, nsWindow object will leak. (Makoto Hamanaka) -} - -nsIWidgetStore::~nsIWidgetStore() -{ -} - -nsIWidget *nsIWidgetStore::GetMozillaWidget(void) -{ - return mWidget; -} - -//---------------------------------------------------- -// BeOS Sub-Class Window -//---------------------------------------------------- - -nsWindowBeOS::nsWindowBeOS( nsIWidget *aWidgetWindow, BRect aFrame, const char *aName, window_look aLook, - window_feel aFeel, int32 aFlags, int32 aWorkspace ) - : BWindow( aFrame, aName, aLook, aFeel, aFlags, aWorkspace ), - nsIWidgetStore( aWidgetWindow ) -{ - fJustGotBounds = true; -} - -nsWindowBeOS::~nsWindowBeOS() -{ - //placeholder for clean up -} - -bool nsWindowBeOS::QuitRequested( void ) -{ - if (CountChildren() != 0) - { - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::CLOSEWINDOW))) - t->CallMethodAsync(info); - } - } - return true; -} - -void nsWindowBeOS::MessageReceived(BMessage *msg) -{ - // Temp replacement for real DnD. Supports file drop onto window. - if (msg->what == B_SIMPLE_DATA) - { - printf("BWindow::SIMPLE_DATA\n"); - be_app_messenger.SendMessage(msg); - } - BWindow::MessageReceived(msg); -} - -// This function calls KeyDown() for Alt+whatever instead of app_server, -// also used for Destroy workflow -void nsWindowBeOS::DispatchMessage(BMessage *msg, BHandler *handler) -{ - if (msg->what == B_KEY_DOWN && modifiers() & B_COMMAND_KEY) - { - BString bytes; - if (B_OK == msg->FindString("bytes", &bytes)) - { - BView *view = this->CurrentFocus(); - if (view) - view->KeyDown(bytes.String(), bytes.Length()); - } - if (strcmp(bytes.String(),"w") && strcmp(bytes.String(),"W")) - BWindow::DispatchMessage(msg, handler); - } - // In some cases the message don't reach QuitRequested() hook, - // so do it here - else if(msg->what == B_QUIT_REQUESTED) - { - // tells nsWindow to kill me - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::CLOSEWINDOW))) - t->CallMethodAsync(info); - } - } - else - BWindow::DispatchMessage(msg, handler); -} - -//This method serves single purpose here - allows Mozilla to save current window position, -//and restore position on new start. -void nsWindowBeOS::FrameMoved(BPoint origin) -{ - - //determine if the window position actually changed - if (origin.x == lastWindowPoint.x && origin.x == lastWindowPoint.x) - { - //it didn't - don't bother - return; - } - lastWindowPoint = origin; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONMOVE))) - t->CallMethodAsync(info); - } -} - -void nsWindowBeOS::WindowActivated(bool active) -{ -// Calls method ONACTIVATE to dispatch focus ACTIVATE messages - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - uint32 args[2]; - args[0] = (uint32)active; - args[1] = (uint32)this; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONACTIVATE, 2, args))) - t->CallMethodAsync(info); - } -} - -void nsWindowBeOS::WorkspacesChanged(uint32 oldworkspace, uint32 newworkspace) -{ - if (oldworkspace == newworkspace) - return; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - uint32 args[2]; - args[0] = newworkspace; - args[1] = oldworkspace; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONWORKSPACE, 2, args))) - t->CallMethodAsync(info); - } -} - -void nsWindowBeOS::FrameResized(float width, float height) -{ - // We have send message already, and Mozilla still didn't get it - // so don't poke it endlessly with no reason - if (!fJustGotBounds) - return; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONRESIZE))) - { - //Memorize fact of sending message - if (t->CallMethodAsync(info)) - fJustGotBounds = false; - } - } -} - -//---------------------------------------------------- -// BeOS Sub-Class View -//---------------------------------------------------- - -nsViewBeOS::nsViewBeOS(nsIWidget *aWidgetWindow, BRect aFrame, const char *aName, uint32 aResizingMode, uint32 aFlags) - : BView(aFrame, aName, aResizingMode, aFlags), nsIWidgetStore(aWidgetWindow), wheel(.0,.0) -{ - SetViewColor(B_TRANSPARENT_COLOR); - paintregion.MakeEmpty(); - buttons = 0; - fRestoreMouseMask = false; - fJustValidated = true; - fWheelDispatched = true; - fVisible = true; -} - -void nsViewBeOS::SetVisible(bool visible) -{ - if (visible) - SetFlags(Flags() | B_WILL_DRAW); - else - SetFlags(Flags() & ~B_WILL_DRAW); - fVisible = visible; -} - -inline bool nsViewBeOS::Visible() -{ - return fVisible; -} - -void nsViewBeOS::Draw(BRect updateRect) -{ - // Ignore all, we are scrolling. - if (!fVisible) - return; - - paintregion.Include(updateRect); - - // We have send message already, and Mozilla still didn't get it - // so don't poke it endlessly with no reason. Also don't send message - // if update region is empty. - if (paintregion.CountRects() == 0 || !paintregion.Frame().IsValid() || !fJustValidated) - return; - uint32 args[1]; - args[0] = (uint32)this; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - info = new MethodInfo(w, w, nsSwitchToUIThread::ONPAINT, 1, args); - if (info) - { - //Memorize fact of sending message - if (t->CallMethodAsync(info)) - fJustValidated = false; - } - } -} - -// Method to get update rects for asynchronous drawing. -bool nsViewBeOS::GetPaintRegion(BRegion *r) -{ - - // Mozilla got previous ONPAINT message, - // ready for next event. - fJustValidated = true; - if (paintregion.CountRects() == 0) - return false; - r->Include(&paintregion); - return true; -} - -// Method to remove painted rects from pending update region -void nsViewBeOS::Validate(BRegion *reg) -{ - paintregion.Exclude(reg); -} - -BPoint nsViewBeOS::GetWheel() -{ - BPoint retvalue = wheel; - // Mozilla got wheel event, so setting flag and cleaning delta storage - fWheelDispatched = true; - wheel.x = 0; - wheel.y = 0; - return retvalue; -} - -void nsViewBeOS::MouseDown(BPoint point) -{ - if (!fRestoreMouseMask) - mouseMask = SetMouseEventMask(B_POINTER_EVENTS); - fRestoreMouseMask = true; - - //To avoid generating extra mouseevents when there is no change in pos. - mousePos = point; - - uint32 clicks = 0; - BMessage *msg = Window()->CurrentMessage(); - msg->FindInt32("buttons", (int32 *) &buttons); - msg->FindInt32("clicks", (int32 *) &clicks); - - if (0 == buttons) - return; - - nsWindow *w = (nsWindow *) GetMozillaWidget(); - if (w == NULL) - return; - - nsToolkit *t = w->GetToolkit(); - if (t == NULL) - return; - - PRUint16 eventButton = - (buttons & B_PRIMARY_MOUSE_BUTTON) ? nsMouseEvent::eLeftButton : - ((buttons & B_SECONDARY_MOUSE_BUTTON) ? nsMouseEvent::eRightButton : - nsMouseEvent::eMiddleButton); - uint32 args[6]; - args[0] = NS_MOUSE_BUTTON_DOWN; - args[1] = (uint32) point.x; - args[2] = (uint32) point.y; - args[3] = clicks; - args[4] = modifiers(); - args[5] = eventButton; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::BTNCLICK, 6, args))) - t->CallMethodAsync(info); -} - -void nsViewBeOS::MouseMoved(BPoint point, uint32 transit, const BMessage *msg) -{ - //To avoid generating extra mouseevents when there is no change in pos. - //and not entering exiting view. - if (mousePos == point && (transit == B_INSIDE_VIEW || transit == B_OUTSIDE_VIEW)) - return; - - mousePos = point; - - //We didn't start the mouse down and there is no drag in progress, so ignore. - if (NULL == msg && !fRestoreMouseMask && buttons) - return; - - nsWindow *w = (nsWindow *)GetMozillaWidget(); - if (w == NULL) - return; - nsToolkit *t = w->GetToolkit(); - if (t == NULL) - return; - uint32 args[4]; - args[1] = (int32) point.x; - args[2] = (int32) point.y; - args[3] = modifiers(); - - switch (transit) - { - case B_ENTERED_VIEW: - { - args[0] = NULL != msg ? NS_DRAGDROP_ENTER : NS_MOUSE_ENTER; - if (msg == NULL) - break; - nsCOMPtr dragService = do_GetService(kCDragServiceCID); - dragService->StartDragSession(); - //As it may have come from the outside we need to update this. - nsCOMPtr dragSessionBeOS = do_QueryInterface(dragService); - dragSessionBeOS->UpdateDragMessageIfNeeded(new BMessage(*msg)); - } - break; - case B_EXITED_VIEW: - { - args[0] = NULL != msg ? NS_DRAGDROP_EXIT : NS_MOUSE_EXIT; - if (msg == NULL) - break; - nsCOMPtr dragService = do_GetService(kCDragServiceCID); - dragService->EndDragSession(PR_FALSE); - } - break; - default: - args[0]= msg == NULL ? NS_MOUSE_MOVE : NS_DRAGDROP_OVER; - // fire the drag event at the source - if (msg != NULL) { - nsCOMPtr dragService = do_GetService(kCDragServiceCID); - dragService->FireDragEventAtSource(NS_DRAGDROP_DRAG); - } - } - - MethodInfo *moveInfo = nsnull; - if (nsnull != (moveInfo = new MethodInfo(w, w, nsSwitchToUIThread::ONMOUSE, 4, args))) - t->CallMethodAsync(moveInfo); -} - -void nsViewBeOS::MouseUp(BPoint point) -{ - if (fRestoreMouseMask) - { - SetMouseEventMask(mouseMask); - fRestoreMouseMask = false; - } - - //To avoid generating extra mouseevents when there is no change in pos. - mousePos = point; - - PRUint16 eventButton = - (buttons & B_PRIMARY_MOUSE_BUTTON) ? nsMouseEvent::eLeftButton : - ((buttons & B_SECONDARY_MOUSE_BUTTON) ? nsMouseEvent::eRightButton : - nsMouseEvent::eMiddleButton); - - nsWindow *w = (nsWindow *)GetMozillaWidget(); - if (w == NULL) - return; - nsToolkit *t = w->GetToolkit(); - if (t == NULL) - return; - - - uint32 args[6]; - args[0] = NS_MOUSE_BUTTON_UP; - args[1] = (uint32) point.x; - args[2] = (int32) point.y; - args[3] = 0; - args[4] = modifiers(); - args[5] = eventButton; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::BTNCLICK, 6, args))) - t->CallMethodAsync(info); -} - -void nsViewBeOS::MessageReceived(BMessage *msg) -{ - if(msg->WasDropped()) - { - nsWindow *w = (nsWindow *)GetMozillaWidget(); - if (w == NULL) - return; - nsToolkit *t = w->GetToolkit(); - if (t == NULL) - return; - - uint32 args[4]; - args[0] = NS_DRAGDROP_DROP; - - //Drop point is in screen-cordinates - BPoint aPoint = ConvertFromScreen(msg->DropPoint()); - - args[1] = (uint32) aPoint.x; - args[2] = (uint32) aPoint.y; - args[3] = modifiers(); - - MethodInfo *info = new MethodInfo(w, w, nsSwitchToUIThread::ONDROP, 4, args); - t->CallMethodAsync(info); - BView::MessageReceived(msg); - return; - } - - switch(msg->what) - { - //Native drag'n'drop negotiation - case B_COPY_TARGET: - case B_MOVE_TARGET: - case B_LINK_TARGET: - case B_TRASH_TARGET: - { - nsCOMPtr dragService = do_GetService(kCDragServiceCID); - nsCOMPtr dragSessionBeOS = do_QueryInterface(dragService); - dragSessionBeOS->TransmitData(new BMessage(*msg)); - } - break; - case B_UNMAPPED_KEY_DOWN: - //printf("unmapped_key_down\n"); - KeyDown(NULL, 0); - break; - - case B_UNMAPPED_KEY_UP: - //printf("unmapped_key_up\n"); - KeyUp(NULL, 0); - break; - - case B_MOUSE_WHEEL_CHANGED: - { - float wheel_y; - float wheel_x; - - msg->FindFloat ("be:wheel_delta_y", &wheel_y); - msg->FindFloat ("be:wheel_delta_x", &wheel_x); - wheel.x += wheel_x; - wheel.y += wheel_y; - - if(!fWheelDispatched || (nscoord(wheel_x) == 0 && nscoord(wheel_y) == 0)) - return; - uint32 args[1]; - args[0] = (uint32)this; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - - if (w && (t = w->GetToolkit()) != 0) - { - - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONWHEEL, 1, args))) - { - if (t->CallMethodAsync(info)) - fWheelDispatched = false; - - } - } - } - break; - -#if defined(BeIME) - case B_INPUT_METHOD_EVENT: - DoIME(msg); - break; -#endif - default : - BView::MessageReceived(msg); - break; - } -} - -void nsViewBeOS::KeyDown(const char *bytes, int32 numBytes) -{ - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - int32 keycode = 0; - int32 rawcode = 0; - - BMessage *msg = this->Window()->CurrentMessage(); - if (msg) - { - msg->FindInt32("key", &keycode); - msg->FindInt32("raw_char", &rawcode); - } - - if (w && (t = w->GetToolkit()) != 0) - { - uint32 bytebuf = 0; - uint8 *byteptr = (uint8 *)&bytebuf; - for(int32 i = 0; i < numBytes; i++) - byteptr[i] = bytes[i]; - - uint32 args[6]; - args[0] = NS_KEY_DOWN; - args[1] = bytebuf; - args[2] = numBytes; - args[3] = modifiers(); - args[4] = keycode; - args[5] = rawcode; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONKEY, 6, args))) - t->CallMethodAsync(info); - } -} - -void nsViewBeOS::KeyUp(const char *bytes, int32 numBytes) -{ - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - int32 keycode = 0; - int32 rawcode = 0; - BMessage *msg = this->Window()->CurrentMessage(); - if (msg) - { - msg->FindInt32("key", &keycode); - msg->FindInt32("raw_char", &rawcode); - } - - if (w && (t = w->GetToolkit()) != 0) - { - uint32 bytebuf = 0; - uint8 *byteptr = (uint8 *)&bytebuf; - for(int32 i = 0; i < numBytes; i++) - byteptr[i] = bytes[i]; - - uint32 args[6]; - args[0] = NS_KEY_UP; - args[1] = (int32)bytebuf; - args[2] = numBytes; - args[3] = modifiers(); - args[4] = keycode; - args[5] = rawcode; - MethodInfo *info = nsnull; - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::ONKEY, 6, args))) - t->CallMethodAsync(info); - } -} - -void nsViewBeOS::MakeFocus(bool focused) -{ - if (!IsFocus() && focused) - BView::MakeFocus(focused); - uint32 args[1]; - args[0] = (uint32)this; - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - if (w && (t = w->GetToolkit()) != 0) - { - MethodInfo *info = nsnull; - if (!focused) - { - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::KILL_FOCUS, 1, args))) - t->CallMethodAsync(info); - } -#ifdef DEBUG_FOCUS - else - { - if (nsnull != (info = new MethodInfo(w, w, nsSwitchToUIThread::GOT_FOCUS, 1, args))) - t->CallMethodAsync(info); - } -#endif - } -} - -#if defined(BeIME) -// Inline Input Method implementation -void nsViewBeOS::DoIME(BMessage *msg) -{ - nsWindow *w = (nsWindow *)GetMozillaWidget(); - nsToolkit *t; - - if(w && (t = w->GetToolkit()) != 0) - { - ssize_t size = msg->FlattenedSize(); - int32 argc = (size+3)/4; - uint32 *args = new uint32[argc]; - if (args) - { - msg->Flatten((char*)args, size); - MethodInfo *info = new MethodInfo(w, w, nsSwitchToUIThread::ONIME, argc, args); - if (info) - { - t->CallMethodAsync(info); - NS_RELEASE(t); - } - delete[] args; - } - } -} -#endif diff --git a/widget/src/beos/nsWindow.h b/widget/src/beos/nsWindow.h deleted file mode 100644 index a3369fe9dc2e..000000000000 --- a/widget/src/beos/nsWindow.h +++ /dev/null @@ -1,341 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Paul Ashford - * Sergei Dolgov - * Fredrik Holmqvist - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef Window_h__ -#define Window_h__ -#define BeIME - -#include "nsBaseWidget.h" -#include "nsdefs.h" -#include "nsSwitchToUIThread.h" -#include "nsToolkit.h" - -#include "nsIWidget.h" - -#include "nsString.h" -#include "nsRegion.h" - -#include -#include -#include - -#if defined(BeIME) -#include -#endif - -#include - -#define NSRGB_2_COLOREF(color) \ - RGB(NS_GET_R(color),NS_GET_G(color),NS_GET_B(color)) - -// forward declaration -class nsViewBeOS; -class nsIRollupListener; -#if defined(BeIME) -class nsIMEBeOS; -#endif - -/** - * Native BeOS window wrapper. - */ - -class nsWindow : public nsSwitchToUIThread, - public nsBaseWidget -{ - -public: - nsWindow(); - virtual ~nsWindow(); - - // In BeOS, each window runs in its own thread. Because of this, - // we have a proxy layer between the mozilla UI thread, and calls made - // within the window's thread via CallMethod(). However, since the windows - // are still running in their own thread, and reference counting takes place within - // that thread, we need to reference and de-reference outselves atomically. - // See BugZilla Bug# 92793 - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIWidget interface - NS_IMETHOD Create(nsIWidget *aParent, - nsNativeWidget aNativeParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIAppShell *aAppShell = nsnull, - nsIToolkit *aToolkit = nsnull, - nsWidgetInitData *aInitData = nsnull); - - gfxASurface* GetThebesSurface(); - - NS_IMETHOD Destroy(); - virtual nsIWidget* GetParent(void); - NS_IMETHOD Show(PRBool bState); - NS_IMETHOD CaptureMouse(PRBool aCapture); - NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, - nsIMenuRollup *aMenuRollup, - PRBool aDoCapture, - PRBool aConsumeRollupEvent); - NS_IMETHOD IsVisible(PRBool & aState); - - NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, - PRInt32 *aX, PRInt32 *aY); - NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); - NS_IMETHOD Resize(PRInt32 aWidth, - PRInt32 aHeight, - PRBool aRepaint); - NS_IMETHOD Resize(PRInt32 aX, - PRInt32 aY, - PRInt32 aWidth, - PRInt32 aHeight, - PRBool aRepaint); - NS_IMETHOD SetModal(PRBool aModal); - NS_IMETHOD Enable(PRBool aState); - NS_IMETHOD IsEnabled(PRBool *aState); - NS_IMETHOD SetFocus(PRBool aRaise); - NS_IMETHOD GetScreenBounds(nsRect &aRect); - NS_IMETHOD SetBackgroundColor(const nscolor &aColor); - NS_IMETHOD SetCursor(nsCursor aCursor); - NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous); - NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, - PRBool aIsSynchronous); - NS_IMETHOD Update(); - virtual void* GetNativeData(PRUint32 aDataType); - NS_IMETHOD SetColorMap(nsColorMap *aColorMap); - NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect); - NS_IMETHOD SetTitle(const nsAString& aTitle); - NS_IMETHOD SetMenuBar(void * aMenuBar) { return NS_ERROR_FAILURE; } - NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; } - NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect); - NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect); - NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus); - NS_IMETHOD HideWindowChrome(PRBool aShouldHide); - - virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) {} - - - // nsSwitchToUIThread interface - virtual bool CallMethod(MethodInfo *info); - virtual PRBool DispatchMouseEvent(PRUint32 aEventType, - nsPoint aPoint, - PRUint32 clicks, - PRUint32 mod, - PRUint16 aButton = nsMouseEvent::eLeftButton); - - - void InitEvent(nsGUIEvent& event, nsPoint* aPoint = nsnull); - NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent); -protected: - - static PRBool EventIsInsideWindow(nsWindow* aWindow, nsPoint pos) ; - static PRBool DealWithPopups(uint32 methodID, nsPoint pos); - // Following methods need to be virtual if we will subclassing - void OnDestroy(); - void OnWheel(PRInt32 aDirection, uint32 aButtons, BPoint aPoint, nscoord aDelta); - PRBool OnMove(PRInt32 aX, PRInt32 aY); - nsresult OnPaint(BRegion *breg); - PRBool OnResize(nsRect &aWindowRect); - PRBool OnKeyDown(PRUint32 aEventType, - const char *bytes, - int32 numBytes, - PRUint32 mod, - PRUint32 bekeycode, - int32 rawcode); - PRBool OnKeyUp(PRUint32 aEventType, - const char *bytes, - int32 numBytes, - PRUint32 mod, - PRUint32 bekeycode, - int32 rawcode); - PRBool DispatchKeyEvent(PRUint32 aEventType, PRUint32 aCharCode, - PRUint32 aKeyCode, PRUint32 aFlags = 0); - PRBool DispatchFocus(PRUint32 aEventType); - static PRBool ConvertStatus(nsEventStatus aStatus) - { return aStatus == nsEventStatus_eConsumeNoDefault; } - PRBool DispatchStandardEvent(PRUint32 aMsg); - - PRBool DispatchWindowEvent(nsGUIEvent* event); - void HideKids(PRBool state); - - virtual already_AddRefed - AllocateChildPopupWidget() - { - static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID); - nsCOMPtr widget = do_CreateInstance(kCPopUpCID); - return widget.forget(); - } - - nsCOMPtr mParent; - nsWindow* mWindowParent; - nsCOMPtr mUpdateArea; - nsIFontMetrics* mFontMetrics; - - nsViewBeOS* mView; - window_feel mBWindowFeel; - window_look mBWindowLook; - - nsRefPtr mThebesSurface; - - //Just for saving space we use packed bools. - PRPackedBool mIsTopWidgetWindow; - PRPackedBool mIsMetaDown; - PRPackedBool mIsShiftDown; - PRPackedBool mIsControlDown; - PRPackedBool mIsAltDown; - PRPackedBool mIsDestroying; - PRPackedBool mIsVisible; - PRPackedBool mEnabled; - PRPackedBool mIsScrolling; - PRPackedBool mListenForResizes; - -public: // public on BeOS to allow BViews to access it - - nsToolkit *GetToolkit() { return (nsToolkit *)nsBaseWidget::GetToolkit(); } -}; - -// -// Each class need to subclass this as part of the subclass -// -class nsIWidgetStore -{ -public: - nsIWidgetStore(nsIWidget *aWindow); - virtual ~nsIWidgetStore(); - - virtual nsIWidget *GetMozillaWidget(void); - -private: - nsIWidget *mWidget; -}; - -// -// A BWindow subclass -// -class nsWindowBeOS : public BWindow, public nsIWidgetStore -{ -public: - nsWindowBeOS(nsIWidget *aWidgetWindow, - BRect aFrame, - const char *aName, - window_look aLook, - window_feel aFeel, - int32 aFlags, - int32 aWorkspace = B_CURRENT_WORKSPACE); - virtual ~nsWindowBeOS(); - - virtual bool QuitRequested( void ); - virtual void MessageReceived(BMessage *msg); - virtual void DispatchMessage(BMessage *msg, BHandler *handler); - virtual void WindowActivated(bool active); - virtual void FrameMoved(BPoint origin); - virtual void WorkspacesChanged(uint32 oldworkspace, uint32 newworkspace); - virtual void FrameResized(float width, float height); - bool fJustGotBounds; -private: - BPoint lastWindowPoint; -}; - -// -// A BView subclass -// -class nsViewBeOS : public BView, public nsIWidgetStore -{ -public: - nsViewBeOS(nsIWidget *aWidgetWindow, - BRect aFrame, - const char *aName, - uint32 aResizingMode, - uint32 aFlags); - - virtual void Draw(BRect updateRect); - virtual void MouseDown(BPoint point); - virtual void MouseMoved(BPoint point, - uint32 transit, - const BMessage *message); - virtual void MouseUp(BPoint point); - bool GetPaintRegion(BRegion *breg); - void Validate(BRegion *reg); - BPoint GetWheel(); - void KeyDown(const char *bytes, int32 numBytes); - void KeyUp(const char *bytes, int32 numBytes); - virtual void MakeFocus(bool focused); - virtual void MessageReceived(BMessage *msg); - void SetVisible(bool visible); - bool Visible(); - BRegion paintregion; - uint32 buttons; - -private: -#if defined(BeIME) - void DoIME(BMessage *msg); -#endif - BPoint mousePos; - uint32 mouseMask; - // actually it is delta, not point, using it as convenient x,y storage - BPoint wheel; - bool fRestoreMouseMask; - bool fJustValidated; - bool fWheelDispatched; - bool fVisible; -}; - -#if defined(BeIME) -class nsIMEBeOS -{ -public: - nsIMEBeOS(); -// virtual ~nsIMEBeOS(); - void RunIME(uint32 *args, nsWindow *owner, BView* view); - void DispatchText(nsString &text, PRUint32 txtCount, nsTextRange* txtRuns); - void DispatchIME(PRUint32 what); - void DispatchCancelIME(); - PRBool DispatchWindowEvent(nsGUIEvent* event); - - static nsIMEBeOS *GetIME(); - -private: - nsWindow* imeTarget; - BMessenger imeMessenger; - nsString imeText; - BPoint imeCaret; - PRUint32 imeState, imeWidth, imeHeight; - static nsIMEBeOS *beosIME; -}; -#endif -#endif // Window_h__ diff --git a/widget/src/beos/nsdefs.h b/widget/src/beos/nsdefs.h deleted file mode 100644 index e7bc6ba49977..000000000000 --- a/widget/src/beos/nsdefs.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef NSDEFS_H -#define NSDEFS_H - -#ifdef _DEBUG - #define BREAK_TO_DEBUGGER DebugBreak() -#else - #define BREAK_TO_DEBUGGER -#endif - -#ifdef _DEBUG - #define VERIFY(exp) ((exp) ? 0: (GetLastError(), BREAK_TO_DEBUGGER)) -#else // !_DEBUG - #define VERIFY(exp) (exp) -#endif // !_DEBUG - -#endif // NSDEFS_H - - diff --git a/widget/src/beos/resource.h b/widget/src/beos/resource.h deleted file mode 100644 index 0bb6be0c0fb7..000000000000 --- a/widget/src/beos/resource.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#define IDC_SELECTANCHOR 4100 - diff --git a/widget/src/xpwidgets/Makefile.in b/widget/src/xpwidgets/Makefile.in index d1cb06a3bdcc..79654983795a 100644 --- a/widget/src/xpwidgets/Makefile.in +++ b/widget/src/xpwidgets/Makefile.in @@ -80,11 +80,11 @@ CPPSRCS += \ $(NULL) endif -ifneq (,$(filter beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) +ifneq (,$(filter os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) CPPSRCS += nsBaseClipboard.cpp endif -ifneq (,$(filter beos qt gtk2 os2 cocoa windows android,$(MOZ_WIDGET_TOOLKIT))) +ifneq (,$(filter qt gtk2 os2 cocoa windows android,$(MOZ_WIDGET_TOOLKIT))) CPPSRCS += nsBaseFilePicker.cpp endif diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 82bf74d4a19e..fac21c5356ba 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -58,12 +58,7 @@ #include #endif -#if defined(XP_BEOS) -/* For DEBUGGER macros */ -#include -#endif - -#if defined(XP_UNIX) || defined(_WIN32) || defined(XP_OS2) || defined(XP_BEOS) +#if defined(XP_UNIX) || defined(_WIN32) || defined(XP_OS2) /* for abort() and getenv() */ #include #endif @@ -402,7 +397,6 @@ RealBreak() #endif #elif defined(XP_OS2) asm("int $3"); -#elif defined(XP_BEOS) #elif defined(XP_MACOSX) raise(SIGTRAP); #elif defined(__GNUC__) && (defined(__i386__) || defined(__i386) || defined(__x86_64__)) @@ -503,9 +497,6 @@ Break(const char *aMsg) if (( code == MBID_ENTER ) || (code == MBID_ERROR)) return; - RealBreak(); -#elif defined(XP_BEOS) - DEBUGGER(aMsg); RealBreak(); #elif defined(XP_MACOSX) /* Note that we put this Mac OS X test above the GNUC/x86 test because the diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in index 9421f4c3ada6..c5004c24a2bf 100644 --- a/xpcom/build/Makefile.in +++ b/xpcom/build/Makefile.in @@ -176,10 +176,6 @@ EXTRA_DSO_LDOPTS += \ $(NULL) endif -ifeq ($(OS_ARCH),BeOS) -EXTRA_DSO_LDOPTS += -lbe -endif - ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) ifdef MOZ_PLATFORM_MAEMO diff --git a/xpcom/build/nsXPCOMPrivate.h b/xpcom/build/nsXPCOMPrivate.h index a5f7e0c49f2c..f0ec79c45422 100644 --- a/xpcom/build/nsXPCOMPrivate.h +++ b/xpcom/build/nsXPCOMPrivate.h @@ -254,15 +254,6 @@ void LogTerm(); #define XUL_DLL "xul.dll" #define LXUL_DLL L"xul.dll" -#elif defined(XP_BEOS) - -#define XPCOM_SEARCH_KEY "ADDON_PATH" -#define GRE_CONF_NAME "gre.config" -#define GRE_CONF_PATH "gre.conf" -#define GRE_CONF_DIR "gre.d" -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#define XUL_DLL "libxul"MOZ_DLL_SUFFIX - #else // Unix #include // for PATH_MAX @@ -287,7 +278,7 @@ void LogTerm(); #if defined(XP_WIN) || defined(XP_OS2) #define XPCOM_FILE_PATH_SEPARATOR "\\" #define XPCOM_ENV_PATH_SEPARATOR ";" -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) #define XPCOM_FILE_PATH_SEPARATOR "/" #define XPCOM_ENV_PATH_SEPARATOR ":" #else diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index bdf6645280a4..e8c1d52a76bb 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -100,12 +100,6 @@ #include NEW_H // for placement new - -#ifdef XP_BEOS -#include -#include -#endif - #include "mozilla/Omnijar.h" #include "nsJAR.h" static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID); diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index 4572f89b5290..d7f8fee3ae41 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -78,7 +78,7 @@ #include #endif -#if defined(DEBUG) && !defined(XP_BEOS) +#ifdef DEBUG #define IMPLEMENT_BREAK_AFTER_LOAD #endif diff --git a/xpcom/ds/nsCRT.h b/xpcom/ds/nsCRT.h index 9096b7024858..f2ed31eab54a 100644 --- a/xpcom/ds/nsCRT.h +++ b/xpcom/ds/nsCRT.h @@ -50,7 +50,7 @@ # define NS_LINEBREAK "\015\012" # define NS_LINEBREAK_LEN 2 #else -# if defined(XP_UNIX) || defined(XP_BEOS) +# ifdef XP_UNIX # define NS_LINEBREAK "\012" # define NS_LINEBREAK_LEN 1 # endif /* XP_UNIX */ diff --git a/xpcom/glue/nsCRTGlue.h b/xpcom/glue/nsCRTGlue.h index 885b2a2c9a98..e16ea38a723a 100644 --- a/xpcom/glue/nsCRTGlue.h +++ b/xpcom/glue/nsCRTGlue.h @@ -146,7 +146,7 @@ NS_COM_GLUE PRBool NS_IsAscii(const char* aString, PRUint32 aLength); #elif defined(XP_WIN) || defined(XP_OS2) #define FILE_PATH_SEPARATOR "\\" #define OS_FILE_ILLEGAL_CHARACTERS "/:*?\"<>|" -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) #define FILE_PATH_SEPARATOR "/" #define OS_FILE_ILLEGAL_CHARACTERS "" #else diff --git a/xpcom/glue/nsGREGlue.cpp b/xpcom/glue/nsGREGlue.cpp index 997957b8d89e..e96d2be482f9 100644 --- a/xpcom/glue/nsGREGlue.cpp +++ b/xpcom/glue/nsGREGlue.cpp @@ -66,15 +66,6 @@ # include # include # include -#elif defined(XP_BEOS) -# include -# include -# include -# include -# include -# include -# include -# include #endif #include @@ -125,7 +116,7 @@ GRE_FindGREFramework(const char* rootPath, PRUint32 propertiesLength, char* buffer, PRUint32 buflen); -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) static PRBool GRE_GetPathFromConfigDir(const char* dirname, @@ -217,15 +208,6 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions, *ptr = '\\'; return NS_OK; } -#elif XP_BEOS - BPath path; - status_t result; - result = path.SetTo(p,0,true); - if (result == B_OK) - { - sprintf(aBuffer, path.Path()); - return NS_OK; - } #else // hope for the best // xxxbsmedberg: other platforms should have a "make absolute" function @@ -367,68 +349,6 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions, return NS_OK; } -#elif defined(XP_BEOS) - env = getenv("MOZ_GRE_CONF"); - if (env && GRE_GetPathFromConfigFile(env, - versions, versionsLength, - allProperties, allPropertiesLength, - aBuffer, aBufLen)) { - return NS_OK; - } - - char p[MAXPATHLEN]; - if (find_directory(B_USER_SETTINGS_DIRECTORY, 0, 0, p, MAXPATHLEN)) { - char buffer[MAXPATHLEN]; - - // Look in B_USER_SETTINGS_DIRECTORY/gre.config - snprintf(buffer, sizeof(buffer), - "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_NAME, p); - - if (GRE_GetPathFromConfigFile(buffer, - versions, versionsLength, - allProperties, allPropertiesLength, - aBuffer, aBufLen)) { - return NS_OK; - } - - // Look in B_USER_SETTINGS_DIRECTORY/gre.d/*.conf - snprintf(buffer, sizeof(buffer), - "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_DIR, p); - - if (GRE_GetPathFromConfigDir(buffer, - versions, versionsLength, - allProperties, allPropertiesLength, - aBuffer, aBufLen)) { - return NS_OK; - } - } - - // Hope Zeta OS and Haiku OS multiuser versions will respect BeBook, - // for BeOS R5 COMMON and USER are equal - if (find_directory(B_COMMON_SETTINGS_DIRECTORY, 0, 0, p, MAXPATHLEN)) { - char buffer[MAXPATHLEN]; - - // Look for a B_COMMON_SETTINGS_DIRECTORY/gre.conf file - snprintf(buffer, sizeof(buffer), - "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_PATH, p); - if (GRE_GetPathFromConfigFile(buffer, - versions, versionsLength, - allProperties, allPropertiesLength, - aBuffer, aBufLen)) { - return NS_OK; - } - - // Look for a group of config files in B_COMMON_SETTINGS_DIRECTORY/gre.d/ - snprintf(buffer, sizeof(buffer), - "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_DIR, p); - if (GRE_GetPathFromConfigDir(buffer, - versions, versionsLength, - allProperties, allPropertiesLength, - aBuffer, aBufLen)) { - return NS_OK; - } - } - #elif defined(XP_WIN) HKEY hRegKey = NULL; @@ -584,7 +504,7 @@ GRE_FindGREFramework(const char* rootPath, return PR_FALSE; } -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) static PRBool IsConfFile(const char *filename) { diff --git a/xpcom/glue/standalone/Makefile.in b/xpcom/glue/standalone/Makefile.in index 01d0c90cdaa4..c84adb899890 100644 --- a/xpcom/glue/standalone/Makefile.in +++ b/xpcom/glue/standalone/Makefile.in @@ -66,9 +66,6 @@ endif ifeq (OS2,$(OS_ARCH)) LINKSRC = nsGlueLinkingOS2.cpp endif -ifeq (BeOS,$(OS_ARCH)) -LINKSRC = nsGlueLinkingBeOS.cpp -endif ifndef LINKSRC LINKSRC = nsGlueLinkingNull.cpp diff --git a/xpcom/glue/standalone/nsGlueLinkingBeOS.cpp b/xpcom/glue/standalone/nsGlueLinkingBeOS.cpp deleted file mode 100644 index 41843a3f56e6..000000000000 --- a/xpcom/glue/standalone/nsGlueLinkingBeOS.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 6; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla XPCOM. - * - * The Initial Developer of the Original Code is - * Benjamin Smedberg - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergei Dolgov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsGlueLinking.h" -#include "nsXPCOMGlue.h" - -#include -#include -#include -#include -#include - -#define LEADING_UNDERSCORE - - -struct DependentLib -{ - image_id libHandle; - DependentLib *next; -}; - -static DependentLib *sTop; -static image_id sXULLibHandle; - -static void -AppendDependentLib(image_id libHandle) -{ - DependentLib *d = new DependentLib; - if (!d) - return; - - d->next = sTop; - d->libHandle = libHandle; - - sTop = d; -} - -static void -ReadDependentCB(const char *aDependentLib) -{ - image_id libHandle = load_add_on(aDependentLib); - if (!libHandle) - return; - - AppendDependentLib(libHandle); -} - -nsresult -XPCOMGlueLoad(const char *xpcomFile, GetFrozenFunctionsFunc *func) -{ - char xpcomDir[MAXPATHLEN]; - BPath libpath; - if (libpath.SetTo(xpcomFile, 0, true) == B_OK) { - sprintf(xpcomDir, libpath.Path()); - char *lastSlash = strrchr(xpcomDir, '/'); - if (lastSlash) { - *lastSlash = '\0'; - - XPCOMGlueLoadDependentLibs(xpcomDir, ReadDependentCB); - - snprintf(lastSlash, MAXPATHLEN - strlen(xpcomDir), "/" XUL_DLL); - - sXULLibHandle = load_add_on(xpcomDir); - } - } - - - image_id libHandle = nsnull; - - if (xpcomFile[0] != '.' || xpcomFile[1] != '\0') { - libHandle = load_add_on(xpcomFile); - if (libHandle) { - AppendDependentLib(libHandle); - } - } - - GetFrozenFunctionsFunc sym = 0; - status_t result; - - result = get_image_symbol(libHandle, - LEADING_UNDERSCORE "NS_GetFrozenFunctions", B_SYMBOL_TYPE_TEXT, (void **)sym); - - if (!sym || B_OK != result) { - XPCOMGlueUnload(); - return NS_ERROR_NOT_AVAILABLE; - } - - *func = sym; - - return OK; -} - -void -XPCOMGlueUnload() -{ - while (sTop) { - unload_add_on(sTop->libHandle); - - DependentLib *temp = sTop; - sTop = sTop->next; - - delete temp; - } - - if (sXULLibHandle) { - unload_add_on(sXULLibHandle); - sXULLibHandle = nsnull; - } -} - -nsresult -XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols) -{ - - nsresult rv = NS_OK; - - while (symbols->functionName) { - char buffer[512]; - snprintf(buffer, sizeof(buffer), - LEADING_UNDERSCORE "%s", symbols->functionName); - - *symbols->function = 0; - status_t result; - result = get_image_symbol(sXULLibHandle, buffer, B_SYMBOL_TYPE_TEXT, (void **)*symbols->function ); - if (!*symbols->function || B_OK != result) - rv = NS_ERROR_LOSS_OF_SIGNIFICANT_DATA; - - ++symbols; - } - return rv; -} diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp index 2e413d061216..adf89a0bcd99 100644 --- a/xpcom/io/SpecialSystemDirectory.cpp +++ b/xpcom/io/SpecialSystemDirectory.cpp @@ -80,18 +80,6 @@ #include #include "prenv.h" -#elif defined(XP_BEOS) - -#include -#include -#include -#include -#include -#include -#include -#include -#include "prenv.h" - #endif #if defined(VMS) @@ -250,31 +238,6 @@ static nsresult GetRegWindowsAppDataFolder(PRBool aLocal, nsILocalFile** aFile) #endif // XP_WIN -#if defined (XP_BEOS) -static nsresult -GetBeOSFolder( directory_which which, dev_t volume, nsILocalFile** aFile) -{ - char path[MAXPATHLEN]; - if (volume < 0) - return NS_ERROR_FAILURE; - - status_t result = find_directory(which, volume, false, path, MAXPATHLEN - 2); - if (result != B_OK) - return NS_ERROR_FAILURE; - - int len = strlen(path); - if (len == 0) - return NS_ERROR_FAILURE; - - if (path[len-1] != '/') - { - path[len] = '/'; - path[len+1] = '\0'; - } - return NS_NewNativeLocalFile(nsDependentCString(path), PR_TRUE, aFile); -} -#endif // XP_BEOS - #if defined(XP_UNIX) static nsresult GetUnixHomeDir(nsILocalFile** aFile) @@ -637,7 +600,7 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, return GetOSXFolderType(kUserDomain, kTemporaryFolderType, aFile); } -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) { static const char *tPath = nsnull; if (!tPath) { @@ -910,31 +873,6 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, return GetUnixXDGUserDirectory(aSystemSystemDirectory, aFile); #endif -#ifdef XP_BEOS - case BeOS_SettingsDirectory: - { - return GetBeOSFolder(B_USER_SETTINGS_DIRECTORY,0, aFile); - } - - case BeOS_HomeDirectory: - { - return GetBeOSFolder(B_USER_DIRECTORY,0, aFile); - } - - case BeOS_DesktopDirectory: - { - /* Get the user's desktop folder, which in the future may differ from the boot desktop */ - char path[MAXPATHLEN]; - if (find_directory(B_USER_DIRECTORY, 0, false, path, MAXPATHLEN) != B_OK ) - break; - return GetBeOSFolder(B_DESKTOP_DIRECTORY, dev_for_path(path), aFile); - } - - case BeOS_SystemDirectory: - { - return GetBeOSFolder(B_BEOS_DIRECTORY,0, aFile); - } -#endif #ifdef XP_OS2 case OS2_SystemDirectory: { diff --git a/xpcom/io/SpecialSystemDirectory.h b/xpcom/io/SpecialSystemDirectory.h index f8f5dbd8825f..617c4e3bc111 100644 --- a/xpcom/io/SpecialSystemDirectory.h +++ b/xpcom/io/SpecialSystemDirectory.h @@ -123,15 +123,10 @@ enum SystemDirectories { Unix_XDG_Templates = 310, Unix_XDG_Videos = 311, - BeOS_SettingsDirectory = 401, - BeOS_HomeDirectory = 402, - BeOS_DesktopDirectory = 403, - BeOS_SystemDirectory = 404, - - OS2_SystemDirectory = 501, - OS2_OS2Directory = 502, - OS2_DesktopDirectory = 503, - OS2_HomeDirectory = 504 + OS2_SystemDirectory = 401, + OS2_OS2Directory = 402, + OS2_DesktopDirectory = 403, + OS2_HomeDirectory = 404 }; nsresult diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp index 7c4787472bb8..e7e996a8697a 100644 --- a/xpcom/io/nsAppFileLocationProvider.cpp +++ b/xpcom/io/nsAppFileLocationProvider.cpp @@ -62,10 +62,6 @@ #include #include #include -#elif defined(XP_BEOS) -#include -#include -#include #endif @@ -362,17 +358,6 @@ NS_METHOD nsAppFileLocationProvider::GetProductDirectory(nsILocalFile **aLocalFi #elif defined(XP_UNIX) rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), PR_TRUE, getter_AddRefs(localDir)); if (NS_FAILED(rv)) return rv; -#elif defined(XP_BEOS) - char path[MAXPATHLEN]; - find_directory(B_USER_SETTINGS_DIRECTORY, 0, 0, path, MAXPATHLEN); - // Need enough space to add the trailing backslash - int len = strlen(path); - if (len > MAXPATHLEN-2) - return NS_ERROR_FAILURE; - path[len] = '/'; - path[len+1] = '\0'; - rv = NS_NewNativeLocalFile(nsDependentCString(path), PR_TRUE, getter_AddRefs(localDir)); - if (NS_FAILED(rv)) return rv; #else #error dont_know_how_to_get_product_dir_on_your_platform #endif @@ -501,7 +486,7 @@ NS_IMPL_ISUPPORTS1(nsAppDirectoryEnumerator, nsISimpleEnumerator) #if defined(XP_WIN) || defined(XP_OS2) /* Win32 and OS/2 */ #define PATH_SEPARATOR ';' -#else /*if defined(XP_UNIX) || defined(XP_BEOS)*/ +#else #define PATH_SEPARATOR ':' #endif diff --git a/xpcom/io/nsDirectoryService.cpp b/xpcom/io/nsDirectoryService.cpp index 75387306496e..645ffc4b0614 100644 --- a/xpcom/io/nsDirectoryService.cpp +++ b/xpcom/io/nsDirectoryService.cpp @@ -67,15 +67,6 @@ #endif #elif defined(XP_OS2) #define MAX_PATH _MAX_PATH -#elif defined(XP_BEOS) -#include -#include -#include -#include -#include -#include -#include -#include "prenv.h" #endif #include "SpecialSystemDirectory.h" @@ -93,8 +84,6 @@ #define HOME_DIR NS_UNIX_HOME_DIR #elif defined (XP_OS2) #define HOME_DIR NS_OS2_HOME_DIR -#elif defined (XP_BEOS) -#define HOME_DIR NS_BEOS_HOME_DIR #endif //---------------------------------------------------------------------------------------- @@ -247,25 +236,6 @@ nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile) *aFile = localFile; return NS_OK; -#elif defined(XP_BEOS) - char buf[MAXPATHLEN]; - int32 cookie = 0; - image_info info; - char *p; - *buf = 0; - if(get_next_image_info(0, &cookie, &info) == B_OK) - { - strcpy(buf, info.name); - if((p = strrchr(buf, '/')) != 0) - { - if( (p-2 >= buf) && *(p-2)=='/' && *(p-1)=='.') - p -=2; - *p = 0; - localFile->InitWithNativePath(nsDependentCString(buf)); - *aFile = localFile; - return NS_OK; - } - } #endif NS_RELEASE(localFile); @@ -975,23 +945,6 @@ nsDirectoryService::GetFile(const char *prop, PRBool *persistent, nsIFile **_ret { rv = GetSpecialSystemDirectory(OS2_DesktopDirectory, getter_AddRefs(localFile)); } -#elif defined (XP_BEOS) - else if (inAtom == nsDirectoryService::sSettingsDirectory) - { - rv = GetSpecialSystemDirectory(BeOS_SettingsDirectory, getter_AddRefs(localFile)); - } - else if (inAtom == nsDirectoryService::sOS_HomeDirectory) - { - rv = GetSpecialSystemDirectory(BeOS_HomeDirectory, getter_AddRefs(localFile)); - } - else if (inAtom == nsDirectoryService::sOS_DesktopDirectory) - { - rv = GetSpecialSystemDirectory(BeOS_DesktopDirectory, getter_AddRefs(localFile)); - } - else if (inAtom == nsDirectoryService::sSystemDirectory) - { - rv = GetSpecialSystemDirectory(BeOS_SystemDirectory, getter_AddRefs(localFile)); - } #endif if (NS_FAILED(rv)) diff --git a/xpcom/io/nsDirectoryServiceAtomList.h b/xpcom/io/nsDirectoryServiceAtomList.h index 635908d15f92..75efa0cd4ba8 100644 --- a/xpcom/io/nsDirectoryServiceAtomList.h +++ b/xpcom/io/nsDirectoryServiceAtomList.h @@ -120,7 +120,4 @@ DIR_ATOM(sXDGVideos, NS_UNIX_XDG_VIDEOS_DIR) #elif defined (XP_OS2) DIR_ATOM(sSystemDirectory, NS_OS_SYSTEM_DIR) DIR_ATOM(sOS2Directory, NS_OS2_DIR) -#elif defined (XP_BEOS) -DIR_ATOM(sSystemDirectory, NS_OS_SYSTEM_DIR) -DIR_ATOM(sSettingsDirectory, NS_BEOS_SETTINGS_DIR) #endif diff --git a/xpcom/io/nsDirectoryServiceDefs.h b/xpcom/io/nsDirectoryServiceDefs.h index ec72188303e8..23cd9a7d41b6 100644 --- a/xpcom/io/nsDirectoryServiceDefs.h +++ b/xpcom/io/nsDirectoryServiceDefs.h @@ -171,10 +171,6 @@ #define NS_OS2_DIR "OS2Dir" #define NS_OS2_HOME_DIR NS_OS_HOME_DIR #define NS_OS2_DESKTOP_DIR NS_OS_DESKTOP_DIR -#elif defined (XP_BEOS) - #define NS_BEOS_SETTINGS_DIR "Setngs" - #define NS_BEOS_HOME_DIR NS_OS_HOME_DIR - #define NS_BEOS_DESKTOP_DIR NS_OS_DESKTOP_DIR #endif /* Deprecated */ diff --git a/xpcom/io/nsLocalFile.h b/xpcom/io/nsLocalFile.h index 5b7507969965..247e42cd95eb 100644 --- a/xpcom/io/nsLocalFile.h +++ b/xpcom/io/nsLocalFile.h @@ -72,7 +72,7 @@ #ifdef XP_WIN #include "nsLocalFileWin.h" -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) #include "nsLocalFileUnix.h" #elif defined(XP_OS2) #include "nsLocalFileOS2.h" diff --git a/xpcom/io/nsLocalFileCommon.cpp b/xpcom/io/nsLocalFileCommon.cpp index d04e0b87cb1b..3816ba40d99c 100644 --- a/xpcom/io/nsLocalFileCommon.cpp +++ b/xpcom/io/nsLocalFileCommon.cpp @@ -190,7 +190,7 @@ nsLocalFile::CreateUnique(PRUint32 type, PRUint32 attributes) #if defined(XP_WIN) || defined(XP_OS2) static const PRUnichar kPathSeparatorChar = '\\'; -#elif defined(XP_UNIX) || defined(XP_BEOS) +#elif defined(XP_UNIX) static const PRUnichar kPathSeparatorChar = '/'; #else #error Need to define file path separator for your platform diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 88be319d1820..9cea87b5fe75 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -58,11 +58,6 @@ #include #include #include -#ifdef XP_BEOS - #include - #include - #include -#endif #if defined(VMS) #include #endif @@ -562,17 +557,8 @@ nsLocalFile::Normalize() char resolved_path[PATH_MAX] = ""; char *resolved_path_ptr = nsnull; -#ifdef XP_BEOS - BEntry be_e(mPath.get(), true); - BPath be_p; - status_t err; - if ((err = be_e.GetPath(&be_p)) == B_OK) { - resolved_path_ptr = (char *)be_p.Path(); - PL_strncpyz(resolved_path, resolved_path_ptr, PATH_MAX - 1); - } -#else resolved_path_ptr = realpath(mPath.get(), resolved_path); -#endif + // if there is an error, the return is null. if (!resolved_path_ptr) return NSRESULT_FOR_ERRNO(); @@ -1362,66 +1348,6 @@ nsLocalFile::GetParent(nsIFile **aParent) */ -#if defined(XP_BEOS) -// access() is buggy in BeOS POSIX implementation, at least for BFS, using stat() instead -// see bug 169506, https://bugzilla.mozilla.org/show_bug.cgi?id=169506 -NS_IMETHODIMP -nsLocalFile::Exists(PRBool *_retval) -{ - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - struct STAT buf; - - *_retval = (STAT(mPath.get(), &buf) == 0); - return NS_OK; -} - -NS_IMETHODIMP -nsLocalFile::IsWritable(PRBool *_retval) -{ - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - struct STAT buf; - - *_retval = (STAT(mPath.get(), &buf) == 0); - if (*_retval || errno == EACCES) { - *_retval = *_retval && (buf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH )); - return NS_OK; - } - return NSRESULT_FOR_ERRNO(); -} - -NS_IMETHODIMP -nsLocalFile::IsReadable(PRBool *_retval) -{ - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - struct STAT buf; - - *_retval = (STAT(mPath.get(), &buf) == 0); - if (*_retval || errno == EACCES) { - *_retval = *_retval && (buf.st_mode & (S_IRUSR | S_IRGRP | S_IROTH )); - return NS_OK; - } - return NSRESULT_FOR_ERRNO(); -} - -NS_IMETHODIMP -nsLocalFile::IsExecutable(PRBool *_retval) -{ - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - struct STAT buf; - - *_retval = (STAT(mPath.get(), &buf) == 0); - if (*_retval || errno == EACCES) { - *_retval = *_retval && (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH )); - return NS_OK; - } - return NSRESULT_FOR_ERRNO(); -} -#else - NS_IMETHODIMP nsLocalFile::Exists(PRBool *_retval) { @@ -1485,7 +1411,7 @@ nsLocalFile::IsExecutable(PRBool *_retval) return NS_OK; return NSRESULT_FOR_ERRNO(); } -#endif + NS_IMETHODIMP nsLocalFile::IsDirectory(PRBool *_retval) { @@ -1793,36 +1719,6 @@ nsLocalFile::SetPersistentDescriptor(const nsACString &aPersistentDescriptor) #endif } -#ifdef XP_BEOS -NS_IMETHODIMP -nsLocalFile::Reveal() -{ - BPath bPath(mPath.get()); - PRBool isDirectory; - if (NS_FAILED(IsDirectory(&isDirectory))) - return NS_ERROR_FAILURE; - - if(!isDirectory) - bPath.GetParent(&bPath); - entry_ref ref; - get_ref_for_path(bPath.Path(),&ref); - BMessage message(B_REFS_RECEIVED); - message.AddRef("refs",&ref); - BMessenger messenger("application/x-vnd.Be-TRAK"); - messenger.SendMessage(&message); - return NS_OK; -} - -NS_IMETHODIMP -nsLocalFile::Launch() -{ - entry_ref ref; - get_ref_for_path (mPath.get(), &ref); - be_roster->Launch (&ref); - - return NS_OK; -} -#else NS_IMETHODIMP nsLocalFile::Reveal() { @@ -1936,7 +1832,6 @@ nsLocalFile::Launch() return NS_ERROR_FAILURE; #endif } -#endif nsresult NS_NewNativeLocalFile(const nsACString &path, PRBool followSymlinks, nsILocalFile **result) diff --git a/xpcom/io/nsNativeCharsetUtils.cpp b/xpcom/io/nsNativeCharsetUtils.cpp index e717d09f4ff9..49a902e0a6aa 100644 --- a/xpcom/io/nsNativeCharsetUtils.cpp +++ b/xpcom/io/nsNativeCharsetUtils.cpp @@ -43,9 +43,9 @@ #include "xpcom-private.h" //----------------------------------------------------------------------------- -// XP_MACOSX or XP_BEOS or ANDROID +// XP_MACOSX or ANDROID //----------------------------------------------------------------------------- -#if defined(XP_BEOS) || defined(XP_MACOSX) || defined(ANDROID) +#if defined(XP_MACOSX) || defined(ANDROID) #include "nsAString.h" #include "nsReadableUtils.h" diff --git a/xpcom/io/nsNativeCharsetUtils.h b/xpcom/io/nsNativeCharsetUtils.h index 258a19cfe1f6..a5990a1347a0 100644 --- a/xpcom/io/nsNativeCharsetUtils.h +++ b/xpcom/io/nsNativeCharsetUtils.h @@ -67,7 +67,7 @@ NS_COM nsresult NS_CopyUnicodeToNative(const nsAString &input, nsACString &outp * system encoding is UTF-8. * On Unix (but not on Mac OS X), it depends on the locale and is not known * in advance (at the compilation time) so that this function needs to be - * a real function. On Mac OS X and BeOS, it's always UTF-8 while on Windows + * a real function. On Mac OS X it's always UTF-8 while on Windows * and other platforms (e.g. OS2), it's never UTF-8. */ #if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(ANDROID) @@ -75,7 +75,7 @@ NS_COM PRBool NS_IsNativeUTF8(); #else inline PRBool NS_IsNativeUTF8() { -#if defined(XP_MACOSX) || defined(XP_BEOS) || defined(ANDROID) +#if defined(XP_MACOSX) || defined(ANDROID) return PR_TRUE; #else return PR_FALSE; diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in index ed6ffe4f3172..d9bc60acbfa6 100644 --- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in +++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in @@ -129,12 +129,6 @@ ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDx86_64) CPPSRCS := xptcinvoke_amd64_openbsd.cpp xptcstubs_amd64_openbsd.cpp endif # -# BeOS/Intel (uses the same unixish_x86 code) -# -ifeq ($(OS_ARCH)$(OS_TEST),BeOSBePC) -CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp -endif -# # Neutrino/Intel (uses the same unixish_x86 code) # ifeq ($(OS_TARGET),NTO) diff --git a/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h b/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h index d453e55bbff6..f4e9a86eff88 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h +++ b/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h @@ -53,15 +53,14 @@ * * For example we might end up with something like: * -* #elif defined(NTO) +* #elif defined(NTO) * # if defined(TYPE1) * # define CFRONT_STYLE_THIS_ADJUST -* # elif defined(TYPE1) +* # elif defined(TYPE2) * # define THUNK_BASED_THIS_ADJUST * # else * # error "need TYPE1 or TYPE2 for NTO" * # endif -* #elif defined(__BEOS__) * * and so on.... * @@ -137,9 +136,6 @@ #define THUNK_BASED_THIS_ADJUST #endif -#elif defined(__BEOS__) -#define CFRONT_STYLE_THIS_ADJUST - #elif defined(__sun__) || defined(__sun) #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ #define THUNK_BASED_THIS_ADJUST diff --git a/xulrunner/app/Makefile.in b/xulrunner/app/Makefile.in index 511ec6651ef6..df8677e1bb5a 100644 --- a/xulrunner/app/Makefile.in +++ b/xulrunner/app/Makefile.in @@ -54,7 +54,7 @@ GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js) DEFINES += -DAB_CD=$(AB_CD) -ifneq (,$(filter BeOS OS2 WINCE WINNT,$(OS_ARCH))) +ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH))) PROGRAM = xulrunner$(BIN_SUFFIX) else PROGRAM = xulrunner-bin$(BIN_SUFFIX) @@ -161,10 +161,6 @@ RCFLAGS += -DDEBUG endif endif -ifeq ($(OS_ARCH),BeOS) -OS_LIBS += -ltracker -endif - ifeq ($(OS_ARCH),OS2) RESFILE=splashos2.res RCFLAGS += -DMOZ_XULRUNNER @@ -204,7 +200,7 @@ endif endif endif -ifneq (,$(filter-out OS2 WINCE WINNT BeOS,$(OS_ARCH))) +ifneq (,$(filter-out OS2 WINCE WINNT,$(OS_ARCH))) ifeq (unix, $(MOZ_FS_LAYOUT)) xulrunner:: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS) diff --git a/xulrunner/stub/nsXULStub.cpp b/xulrunner/stub/nsXULStub.cpp index 59d1be57a186..2c22d050a5ab 100644 --- a/xulrunner/stub/nsXULStub.cpp +++ b/xulrunner/stub/nsXULStub.cpp @@ -79,11 +79,6 @@ #include "nsWindowsWMain.cpp" #endif -#ifdef XP_BEOS -#include -#include -#endif - #define VERSION_MAXLEN 128 static void Output(PRBool isError, const char *fmt, ... ) @@ -294,17 +289,6 @@ main(int argc, char **argv) DosGetInfoBlocks(&ptib, &ppib); DosQueryModuleName(ppib->pib_hmte, sizeof(iniPath), iniPath); -#elif defined(XP_BEOS) - BEntry e((const char *)argv[0], true); // traverse symlink - BPath p; - status_t err; - err = e.GetPath(&p); - NS_ASSERTION(err == B_OK, "realpath failed"); - - if (err == B_OK) - // p.Path returns a pointer, so use strcpy to store path in iniPath - strcpy(iniPath, p.Path()); - #else // on unix, there is no official way to get the path of the current binary. // instead of using the MOZILLA_FIVE_HOME hack, which doesn't scale to