Compare commits

..

1040 Commits

Author SHA1 Message Date
(no author)
c5d6b83e4c This commit was manufactured by cvs2svn to create branch 'CVS'.
git-svn-id: svn://10.0.0.236/branches/CVS@50735 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:53:00 +00:00
shaver%netscape.com
f3548d4772 case correction, scriptability and deprecative comment for nsIEnumerator (r=waterson,brendan)
git-svn-id: svn://10.0.0.236/trunk@50734 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:52:59 +00:00
mjudge%netscape.com
8633625794 oops. for got to check this in last time. bug number is 14795
git-svn-id: svn://10.0.0.236/trunk@50733 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:52:42 +00:00
norris%netscape.com
9323b18962 Fix a Unix warning by removing an unused local variable
git-svn-id: svn://10.0.0.236/trunk@50732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:49:36 +00:00
norris%netscape.com
d8ebef8633 correct a comment.
git-svn-id: svn://10.0.0.236/trunk@50731 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:49:05 +00:00
kmcclusk%netscape.com
d8ff43782f Set vertical-align:baseline for input[type=image] to make it compatible with Nav 4.x
bug #16370; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50730 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:48:02 +00:00
pollmann%netscape.com
806e3f40cd Bugs 16450, 11979, 16576: Add back a CRLF I took out of the form post headers; r=harishd
git-svn-id: svn://10.0.0.236/trunk@50729 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:47:08 +00:00
davidm%netscape.com
b8febcc271 14974 apprunner fails to start up on B&W G3 8.6
Add file to generate logs on the mac
r sdagley


git-svn-id: svn://10.0.0.236/trunk@50728 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:46:27 +00:00
norris%netscape.com
814809437c Fix bug 16303. r=alecf@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50727 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:40 +00:00
davidm%netscape.com
4d52510e79 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50726 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:20 +00:00
kmcclusk%netscape.com
440593ffd1 When submitting a form using a "get" method only add the ? if the href does not end in a ?.
bug #16137 r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50725 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:02 +00:00
kmcclusk%netscape.com
9827b1d455 Return the value of the option element value attribute if it is present otherwise return
the content of the option. bug #16158. r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50724 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:41:40 +00:00
morse%netscape.com
19b5a1e558 fix bug 16357, memory leak, r=neeti
git-svn-id: svn://10.0.0.236/trunk@50723 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:37:35 +00:00
harishd%netscape.com
1cd0327569 Bug fix 2749 - Tweaked comment handling in quirks mode.
Bug fix 15992 - Line breaks within script and style were not getting counted
Related to bug 15423 - Rectified a glitch in Nav. DTD code where a doctype tag
                                         was opening up a body.
Userdefined tags are now treated as containers.
Added Kipp's Leaky Tool

r=pollmann.


git-svn-id: svn://10.0.0.236/trunk@50722 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:37:21 +00:00
morse%netscape.com
75a2c4fce1 fix bug 16348, memory leak, r=neeti
git-svn-id: svn://10.0.0.236/trunk@50721 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:36:50 +00:00
sdagley%netscape.com
6f9ff35120 Enforce _MD_DEFAULT_STACK_SIZE as the minimum stack size on Mac. r=beard
git-svn-id: svn://10.0.0.236/trunk@50720 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:33:13 +00:00
pepper%netscape.com
7f58cc3a0b Changed friend declaration to make HP compilers happy.
aCC requires a decl of friend class ClassName instead of friend ClassName.
r=peterl@netscape.com,mgleeson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50719 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:31:07 +00:00
ssu%netscape.com
6277f3a3b3 fixes bug #16246, #16312, #16344, #16308. r=dbragg@netscape.com. fixes crash bug if the install file operation fails. no longer crashes.
git-svn-id: svn://10.0.0.236/trunk@50718 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:30:56 +00:00
kipp%netscape.com
a4a3169649 r=dougt; fixed a warning
git-svn-id: svn://10.0.0.236/trunk@50717 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:30:39 +00:00
sdagley%netscape.com
072fc1a666 Marking all Mac threads as GCable for leak detector work. Bug #15906. r=beard
git-svn-id: svn://10.0.0.236/trunk@50716 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:29:34 +00:00
pepper%netscape.com
0c627abfcd Added missing newline at end of file to make the HP compilers happy.
r=mgleeson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50715 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:28:17 +00:00
alecf%netscape.com
3185d0a81d add boehm to apprunner
(flag not active in build yet)


git-svn-id: svn://10.0.0.236/trunk@50714 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:27:45 +00:00
alecf%netscape.com
4d423eecaf add boehm leak detector support to xpcom on linux
(these flags not active in the build yet)


git-svn-id: svn://10.0.0.236/trunk@50713 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:26:41 +00:00
wtc%netscape.com
0317a9ec8d Bugsplat bug #365543: removed the PRIntn typecast in the definition of
PR_TRUE and PR_FALSE.


git-svn-id: svn://10.0.0.236/trunk@50712 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:25:01 +00:00
alecf%netscape.com
c8460fa4ce tweaks to make generic_threads work on linux
not part of build


git-svn-id: svn://10.0.0.236/trunk@50711 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:24:34 +00:00
alecf%netscape.com
2fce42c8be more tweaks to make beard's generic_threads stuff work on linux
linux already has some of these routines implemented with pthread-specifics
not part of build = no reviewer/bug


git-svn-id: svn://10.0.0.236/trunk@50710 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:22:17 +00:00
mgleeson1%netscape.com
34c5281c43 r=pepper HPUX specific change - enable 64-bit int for js
git-svn-id: svn://10.0.0.236/trunk@50709 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:20:27 +00:00
wtc%netscape.com
463f69ae27 Bugzilla bug #14126: quote $(OS_RELEASE) in the shell command.
Thanks to Greg Noel <GregNoel@san.rr.com> for the bug report
and the fix.  Reviewed by Greg Noel and tested on several flavors
of Linux (x86, sparc, alpha, and ppc) and FreeBSD.


git-svn-id: svn://10.0.0.236/trunk@50708 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:17:38 +00:00
mcafee%netscape.com
8ebe80d3dc Better warning messages. r=pavlov.
git-svn-id: svn://10.0.0.236/trunk@50707 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:13:39 +00:00
kipp%netscape.com
37a76d8a25 r=Tomi.Leppikangas@oulu.fi; landed his patch for solaris build issues
git-svn-id: svn://10.0.0.236/trunk@50706 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:11:44 +00:00
kipp%netscape.com
63bce01588 Fixed edge case where line bounds wasn't quite accurate which causes the combined rect to not match which now wastes memory; only affects right aligned lines
git-svn-id: svn://10.0.0.236/trunk@50705 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:10:59 +00:00
kipp%netscape.com
18e9b9d2f5 r=troy; Reworked nsLineBox api to allow for reduced storage overhead; fixed bug 16252 while keeping bug 12709 fixed
git-svn-id: svn://10.0.0.236/trunk@50704 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:10:03 +00:00
jband%netscape.com
b3711cec39 Fixing leaks found by beard...
- Fixed leaked nsID ptr. bug 16373. This alsothrows a JS
exception when JS callers call createInstance or getService
using an (optional) param that is not an iid. This had been a
'XXX' in the code.
- Moved a release call out of just the error condition block in
setting up a ServiceReleaser. I should have caught this one, but
few of my tests use services :(  I have hopes that the whole
ServiceReleaser will become unnecessary as the ServiceManager
system changes and simply calling NS_RELEASE on a service becomes
sufficient.
- Cleaned up an addref/release pair in a setter (need to move to
nsComPtrs!) r=beard


git-svn-id: svn://10.0.0.236/trunk@50703 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:59 +00:00
kipp%netscape.com
dde9a9185e r=troy; Use a custom frame type so that bullets show up properly in the frame sizing data
git-svn-id: svn://10.0.0.236/trunk@50702 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:58 +00:00
kipp%netscape.com
3f737c9dc4 r=troy; Added some more atoms so that Dframe sizing data is more particular for line boxes
git-svn-id: svn://10.0.0.236/trunk@50701 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:31 +00:00
kipp%netscape.com
873c0b8d47 r=troy; Added a #define to prevent future code crashes
git-svn-id: svn://10.0.0.236/trunk@50700 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:04 +00:00
ftang%netscape.com
2a3924d2e0 fix Shift+a does not produce A in editor problem. We need to clean up isShift before we send. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@50699 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:04:57 +00:00
kipp%netscape.com
a542382c77 Added a new table regression test
git-svn-id: svn://10.0.0.236/trunk@50698 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:58:41 +00:00
terry%mozilla.org
909afc64d2 Patch by holger@holger.om.org (Holger Schurig) -- was not correctly fixing up the 'when' column in the bugs_activity table.
git-svn-id: svn://10.0.0.236/trunk@50697 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:35:12 +00:00
terry%mozilla.org
270c5df832 Patch by holger@holger.om.org (Holger Schurig) -- get the permissions right on the shadow directory.
git-svn-id: svn://10.0.0.236/trunk@50696 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:32:44 +00:00
ftang%netscape.com
da9f453e91 fix problem with url bar trancation. Do not send extra key press for non A-Z0-9
git-svn-id: svn://10.0.0.236/trunk@50695 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 21:49:49 +00:00
brade%netscape.com
6bc5327b10 add nspr shlb to optimized too (to fix probably future mac bustage); remove bad path (r=sfraser@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@50694 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:34:38 +00:00
ssu%netscape.com
0acd8acee3 fixing bug #16242. approved by leaf. r=leaf. removes jre122 from the mozilla installer. not part of tinderbox. would only affect windows.
git-svn-id: svn://10.0.0.236/trunk@50693 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:23:22 +00:00
brade%netscape.com
9c363797fa add nspr shlb to debug to fix mac build bustage
git-svn-id: svn://10.0.0.236/trunk@50692 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:18:30 +00:00
dmose%mozilla.org
f0ad8b22a7 fix to cope with checkins.when column name change to checkins.ci_when
git-svn-id: svn://10.0.0.236/trunk@50691 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:10:30 +00:00
ftang%netscape.com
0abb41fb24 fix the problem taht PageUp/PageDown/Up/Down/Left/Right/Home/End does not work after we land the keyevent branch. add missing isMeta code there
git-svn-id: svn://10.0.0.236/trunk@50690 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:03:00 +00:00
ftang%netscape.com
2d2a382150 landing keyEvent_19991004_BRANCH
bugs # see the log of the check in into branch
author/reviewer:
mozilla/layout/base/src/nsRangeList.cpp brade/mjudge
mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp brade/ftang
mozilla/layout/events/src/nsDOMEvent.cpp brade/joki
mozilla/layout/events/src/nsEventStateManager.cpp brade/joki
mozilla/widget/public/nsGUIEvent.h akkana/ftang
mozilla/widget/src/windows/nsWindow.cpp ftang/mjudge
mozilla/widget/src/windows/nsWindow.h ftang/mjudge
mozilla/widget/src/mac/nsTextAreaWidget.cpp brade/ftang
mozilla/widget/src/mac/nsMacEventHandler.cpp brade/simon
mozilla/widget/src/xpwidgets/nsKeyBindMgr.cpp brade/ftang
mozilla/widget/src/gtk/nsGtkEventHandler.cpp akkana/?
mozilla/widget/src/gtk/nsWidget.cpp erik/ftang
mozilla/layout/xul/base/src/nsTreeCellFrame.cpp brade/ftang
mozilla/editor/base/nsEditorEventListeners.cpp brade/akkana
mozilla/editor/base/nsHTMLEditor.cpp brade/akkana
mozilla/rdf/content/src/nsXULKeyListener.cpp ftang/saari
fix the master bug- 15693
fix at least, but not limited to, the following bugs
10158,11956,6053,9333,10901,14348,6449,11845,13016,14410,15657,15307,15842,13856


git-svn-id: svn://10.0.0.236/trunk@50688 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 18:27:01 +00:00
alecf%netscape.com
74f7c311eb fix back/forward buttons, #16415
a=leaf


git-svn-id: svn://10.0.0.236/trunk@50687 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 18:26:13 +00:00
terry%mozilla.org
210deb53ba Fix invalid SQL introduced by last patch.
git-svn-id: svn://10.0.0.236/trunk@50686 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 17:34:00 +00:00
terry%mozilla.org
e121b35d4c Allow sorting of status whiteboard column.
git-svn-id: svn://10.0.0.236/trunk@50685 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 17:21:43 +00:00
srinivas%netscape.com
3b846f9edf Add autoconf for NSPR. Check in for cls@seawood.org. Buzill 11893
git-svn-id: svn://10.0.0.236/trunk@50684 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 15:09:11 +00:00
rods%netscape.com
f2b4462a33 This corrects an erroneous checkin made on monday, fixes bug #16362 r=dcone
git-svn-id: svn://10.0.0.236/trunk@50683 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:55:08 +00:00
srinivas%netscape.com
e68238933b Autconf for NSPR. Checkin for cls@seawood.org. Bugzill #11893.
git-svn-id: svn://10.0.0.236/trunk@50682 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:50:38 +00:00
kipp%netscape.com
49f795c9c9 Make necko work with the viewer again
git-svn-id: svn://10.0.0.236/trunk@50681 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:43:59 +00:00
brade%netscape.com
bbc03d38ad remove dbl-click message (per joki); dblclick message is causing bug #14990; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50680 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:22:22 +00:00
brade%netscape.com
eb9061c0ef add nsXULControllers.cpp for hyatt (fix mac bustage)
git-svn-id: svn://10.0.0.236/trunk@50679 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:14:55 +00:00
brade%netscape.com
093237bea8 add nsIControllers.idl for hyatt (fix mac build bustage)
git-svn-id: svn://10.0.0.236/trunk@50678 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:56:34 +00:00
morse%netscape.com
9cbd053f44 fix bug 10434, memory leak detection, r=kin
git-svn-id: svn://10.0.0.236/trunk@50677 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:50:36 +00:00
morse%netscape.com
789e4a6e68 fix bug 10434, memory leak detection, r=valeski
git-svn-id: svn://10.0.0.236/trunk@50676 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:36:33 +00:00
hyatt%netscape.com
b895b64505 Fixing warnings. r=travis
git-svn-id: svn://10.0.0.236/trunk@50675 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 12:02:32 +00:00
hyatt%netscape.com
3e56d44211 Fixing linux bustage. Typo in makefile.
git-svn-id: svn://10.0.0.236/trunk@50674 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 11:18:03 +00:00
tbogard%aol.net
226a10c27a Changed the content area of navigator to use the new browser tag rather than html:iframe. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50673 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 11:00:21 +00:00
hyatt%netscape.com
9259952dca Landing re-architected command dispatcher. r=hangas(XUL/JS), saari(C++)
git-svn-id: svn://10.0.0.236/trunk@50672 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:58:25 +00:00
tbogard%aol.net
d548e091c7 Fixed a number of incorrect assumptions of the attribute retrieval so it would now work with the of new XUL content nodes (iframe, browser, editor). r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50671 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:58:04 +00:00
tbogard%aol.net
e623d0cd2b Adding construction for new XUL tags "iframe", "editor", and "browser". r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50670 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:55:24 +00:00
tbogard%aol.net
645b1aba54 Adding new XUL tags, "iframe", "browser", "editor". r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50669 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:54:32 +00:00
tbogard%aol.net
9cb4c25b8a Added rules for the new browser, editor and iframe types. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50668 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:50:10 +00:00
sgehani%netscape.com
04a7745986 *** NOT PART OF BUILD ***
Fixed bug 11216: Cascading dependencies feature
   
Fixed bug 14320: Parser and action support for the LAUNCHAPP atribute
   
Fixed bug 14322: Mouse over displays component description
   
Fixed bug 16224: Mac Install Wizard crashing when installing custom components


git-svn-id: svn://10.0.0.236/trunk@50667 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 08:30:29 +00:00
sgehani%netscape.com
e33d697bbd Divide by 1024 rather than 1000 when calculating component install sizes. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@50666 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 08:15:35 +00:00
locka%iol.ie
3e4a7413ef Seperated webshell initialisation/termination out into their own methods. Added support to run Mozilla control from any directory with calls to the new NS_InitXPCOM and some new registry keys.
git-svn-id: svn://10.0.0.236/trunk@50665 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:46:55 +00:00
locka%iol.ie
e08fc8df48 Added context popup menu resources
git-svn-id: svn://10.0.0.236/trunk@50664 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:44:40 +00:00
locka%iol.ie
9d3f958db2 Added simple working implementation of drag and drop. Control now accepts a URL dragged and dropped from the IE address bar.
git-svn-id: svn://10.0.0.236/trunk@50663 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:43:50 +00:00
alecf%netscape.com
4cb578fb28 fix for #16303 - work around DOM security by specifying absolute chrome URLs
patch from norris, r=alecf


git-svn-id: svn://10.0.0.236/trunk@50662 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:07:43 +00:00
alecf%netscape.com
067e9e08c7 more tweaks to actually make this do useful things with linux - override malloc with GC_malloc
git-svn-id: svn://10.0.0.236/trunk@50659 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 05:34:21 +00:00
alecf%netscape.com
b7e4e49c84 make this link on rh60 - the pthreads that comes with rh60 doesn't allow direct access to __pthread_initial_thread_box, which was only used as a test anyway
git-svn-id: svn://10.0.0.236/trunk@50658 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 05:33:46 +00:00
troy%netscape.com
3007f63368 b=15388,15408 r=peterl@netscape.com
Made it so that for absolutely positioned frames we pass in the containing
block width/height to the HTML reflow state, rather than have it compute it.
This means we get a bottom up size rather than a top down size. That fixes
a problem where for containing blocks with a specified 'height' of 'auto' we
weren't correctly calculating the containing block height


git-svn-id: svn://10.0.0.236/trunk@50657 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:56:50 +00:00
troy%netscape.com
bc13612958 b=16238. Fix discussed with evaughan@netscape. One line change to make sure
the default area frame flag of NS_BLOCK_SPACE_MGR is used for scrolled
elements


git-svn-id: svn://10.0.0.236/trunk@50656 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:47:18 +00:00
warren%netscape.com
18d4872487 Reordered columns as per macafee's suggestion.
git-svn-id: svn://10.0.0.236/trunk@50655 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:37:13 +00:00
troy%netscape.com
50fb78a575 Space reductions for nsTableFrame. r=karnaze@netscape.com and changes Cc'd to
Hyatt. Tested extensively in apprunner (now mozilla). Change was to reduce from
10 to 5 the default size of the mColumnWidths array (note that the array is
dynamically grown if necessary). This reduces by 20 bytes the minimum table
frame size


git-svn-id: svn://10.0.0.236/trunk@50654 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:27:01 +00:00
karnaze%netscape.com
43efe84083 bug 15247 - ComputeAvailableTableWidth accounts for margins
git-svn-id: svn://10.0.0.236/trunk@50653 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:03:20 +00:00
karnaze%netscape.com
14d9729d57 cells with width=0 become auto, added comments
git-svn-id: svn://10.0.0.236/trunk@50652 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:01:26 +00:00
karnaze%netscape.com
1c91cf67ee new regression tests
git-svn-id: svn://10.0.0.236/trunk@50651 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 03:59:42 +00:00
ssu%netscape.com
661f8f1993 fixing bug #16064. checking in for dveditz@netscape.com. r=ssu@netscape.com. This fixes the crash under win98 when running from the windows installer.
git-svn-id: svn://10.0.0.236/trunk@50650 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 03:26:22 +00:00
srinivas%netscape.com
33f38025b2 Enable specification of minimum stack size.
git-svn-id: svn://10.0.0.236/trunk@50649 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:33:14 +00:00
jefft%netscape.com
f59d48eecf enable message move/copy {File Here} menu item; bug 13880, r= hangas
git-svn-id: svn://10.0.0.236/trunk@50648 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:20:02 +00:00
rhp%netscape.com
36d221edd9 Fix for attachment count - bug #16076 - reviewer: jefft
git-svn-id: svn://10.0.0.236/trunk@50647 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:05:20 +00:00
alecf%netscape.com
e39c37dd58 one down, one to go
git-svn-id: svn://10.0.0.236/trunk@50646 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:01:40 +00:00
beard%netscape.com
2975241aaf added support for "about:bloat?leaks". bug=15906,r=warren
git-svn-id: svn://10.0.0.236/trunk@50645 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:56:49 +00:00
varada%netscape.com
60280cb48a fix for bug #6348 -new field called Title is to be added in each ini file for the show example
git-svn-id: svn://10.0.0.236/trunk@50644 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:56:43 +00:00
evaughan%netscape.com
c89e48e233 Fixed gfx scrollbars style rule. Reviewed by Hyatt
git-svn-id: svn://10.0.0.236/trunk@50642 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:55:41 +00:00
alecf%netscape.com
af6d54dbdd convert to nsIModule
r=sspitzer
no bug


git-svn-id: svn://10.0.0.236/trunk@50640 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:40:27 +00:00
mcafee%netscape.com
ea6a04a363 Backing out quotes change for (14663), r=matt
git-svn-id: svn://10.0.0.236/trunk@50639 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:38:22 +00:00
varada%netscape.com
9acc778e9e bug #10361 config in title
git-svn-id: svn://10.0.0.236/trunk@50637 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:23:02 +00:00
varada%netscape.com
9b7d72b4f3 fix for bug #10361 - make neccessary changes in ini files in the title
git-svn-id: svn://10.0.0.236/trunk@50636 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:21:01 +00:00
bienvenu%netscape.com
48263cb73e real fix for build bustage
git-svn-id: svn://10.0.0.236/trunk@50635 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:02:23 +00:00
peterl%netscape.com
946d493f92 moved style rule cascading logic into a stand-alone rule processor
the rule processor can now cascade rules from multiple style sheets
fix for bug 12401 & 12106
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50634 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:59:21 +00:00
peterl%netscape.com
c7896988cd factored out parsing of style attribute
deferred parsing of style attribute until content
is connected to a document
Fix for bug 14986
r=vidur


git-svn-id: svn://10.0.0.236/trunk@50633 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:57:37 +00:00
peterl%netscape.com
866322d95e added an assertion to help track down Bug 14238
r=troy


git-svn-id: svn://10.0.0.236/trunk@50632 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:56:30 +00:00
cyeh%netscape.com
8ba9c7c1f8 move megahal initialization so that if there is a nick collision and we
die, we at least don't leave a forked process behind.


git-svn-id: svn://10.0.0.236/trunk@50631 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:44:37 +00:00
don%netscape.com
7491373c1e Fixed build bustage.
git-svn-id: svn://10.0.0.236/trunk@50630 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:39:45 +00:00
varada%netscape.com
0a71d36864 rewriting verifyval to compare values
git-svn-id: svn://10.0.0.236/trunk@50629 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:39:31 +00:00
Jerry.Kirk%Nexwarecorp.com
5f745cfd66 These changes fix a draw problem when a top-level window was Move'd
Bug=16325 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50628 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:33:49 +00:00
cmanske%netscape.com
1347e8f244 Fixed bugs 16204, 16118, 15831,15448,14342(partial) r=mjudge
git-svn-id: svn://10.0.0.236/trunk@50627 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:13:27 +00:00
cmanske%netscape.com
376ee7ffc4 Fixed bug 16118, part of fix for 14342. Reduced size of ender input widget. r=hyatt,hangas
git-svn-id: svn://10.0.0.236/trunk@50626 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:13:21 +00:00
beard%netscape.com
c49f31fb70 fixing a memory leak, just use an nsAutoString. bug=15380, r=harishd
git-svn-id: svn://10.0.0.236/trunk@50625 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:59:27 +00:00
alecf%netscape.com
064759d0a6 make this compile with -pedantic on Linux 2.2
git-svn-id: svn://10.0.0.236/trunk@50624 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:58:25 +00:00
alecf%netscape.com
4cc8b798cc add new makefile for our build system
git-svn-id: svn://10.0.0.236/trunk@50623 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:58:09 +00:00
alecf%netscape.com
e8c68e85db move old Boehm makefile to Makefile.unix
(not part of build)


git-svn-id: svn://10.0.0.236/trunk@50622 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:57:38 +00:00
bienvenu%netscape.com
2d2078838d add close method to datasources, r=mscott, no bug, but fixes some shutdown memory leaks
git-svn-id: svn://10.0.0.236/trunk@50621 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:55:57 +00:00
beard%netscape.com
06ca9ef5c4 make stack crawl instructions addresses reflect call site, not return address. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50620 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:45:40 +00:00
beard%netscape.com
a0aa1b960a Rewrote using Mac file I/O, since MSL can only manage 35 FILEs. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50619 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:45:03 +00:00
beard%netscape.com
34cb9deb75 for now, let leak detector reclaim block. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50618 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:44:55 +00:00
beard%netscape.com
6dfda342cc html-ized the report, added -blame option.
git-svn-id: svn://10.0.0.236/trunk@50617 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:42:49 +00:00
alecf%netscape.com
416447022b fix typo (gif not dif)
talked to cmanske about this, no review necessary


git-svn-id: svn://10.0.0.236/trunk@50616 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:39:52 +00:00
dveditz%netscape.com
c5129bc74b added directory recursion feature to makecopy.exe, r=dougt
git-svn-id: svn://10.0.0.236/trunk@50615 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:37:24 +00:00
varada%netscape.com
59aaafb7d0 fix for bug #6569
git-svn-id: svn://10.0.0.236/trunk@50614 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 21:30:51 +00:00
terry%mozilla.org
10a148d16b Removing the last vote on a bug was causing an SQL error.
git-svn-id: svn://10.0.0.236/trunk@50611 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 20:17:01 +00:00
selmer%netscape.com
9c33ecf2b8 fix 15325 - don't allow dupl config
git-svn-id: svn://10.0.0.236/trunk@50607 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:55:13 +00:00
selmer%netscape.com
73b2bf9d78 Can't have commands after a Reload
git-svn-id: svn://10.0.0.236/trunk@50606 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:24:41 +00:00
wtc%netscape.com
78e2d8b9b1 Fixed an error of incorrect return value type in _MD_DeleteSharedMemory.
git-svn-id: svn://10.0.0.236/trunk@50603 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:17:05 +00:00
larryh%netscape.com
c2335df585 NSPR 3.5 landing
git-svn-id: svn://10.0.0.236/trunk@50602 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 18:32:42 +00:00
rbs%maths.uq.edu.au
28de62d660 [MathML] Fix to get the scriptlevel style context back, and minor cleanups.
git-svn-id: svn://10.0.0.236/trunk@50600 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 15:10:14 +00:00
karnaze%netscape.com
d0d34df829 bug 11026 - AllocateUnconstrained was off by 1 twip in some cases. bug 14159 - cell is not fixed width if an auto cell in the same col has a larger desired size for backward compatibilty.
git-svn-id: svn://10.0.0.236/trunk@50599 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:44:22 +00:00
kipp%netscape.com
9c0c764b13 Removed an unsupported argument (-f)
git-svn-id: svn://10.0.0.236/trunk@50598 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:43:04 +00:00
karnaze%netscape.com
12a011a2e9 removed handling of 0 width cells in ComputeAvailableTableWidth since it is done in nsHTMLTableElement. review=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50597 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:39:33 +00:00
karnaze%netscape.com
b893071648 added comments
git-svn-id: svn://10.0.0.236/trunk@50596 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:36:28 +00:00
gagan%netscape.com
6d496c35bf Argh... fix my last fix.
git-svn-id: svn://10.0.0.236/trunk@50595 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 12:16:08 +00:00
gagan%netscape.com
14334bc5ea Fix build bustage on windows.
git-svn-id: svn://10.0.0.236/trunk@50594 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 11:50:14 +00:00
gagan%netscape.com
22f1039803 Fix the windows build bustage. Bad checkin on my part!
git-svn-id: svn://10.0.0.236/trunk@50593 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 11:09:37 +00:00
gagan%netscape.com
a4426a97a5 Removing an #if 0 block that got checked in accidently with my last checkins.
git-svn-id: svn://10.0.0.236/trunk@50592 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:31:16 +00:00
gagan%netscape.com
8d5737519d Removed an unneccesary include statement. No bug number.
git-svn-id: svn://10.0.0.236/trunk@50591 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:28:10 +00:00
gagan%netscape.com
b3785299ff Fix for bug # 10333. Made webshell a progress event sink as well so that now it redirects all progress messages from necko land to the appropriate docloader observer. The hack to delete strings which are being received in the status messages is a work around the current limitation of the proxy event code. When bug # 16273 is fixed that delete wont be necessary. In fixing this I also noticed that the nsFileTransport wasn't using the proxy events and was incorrectly firing status messages directly onto the UI thread. Fixed that as well. r=rpotts,warren
git-svn-id: svn://10.0.0.236/trunk@50588 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:24:12 +00:00
waterson%netscape.com
821cb4f5b2 Factor out dirtying of tree, fixed bug with dynamic column creation due to row addition. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50587 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:53:57 +00:00
waterson%netscape.com
250dbce4cf Add check-for-null-pointer to FireOnSelectHandler() to avoid crashing in the case where a select handler fires on an 'orphaned' node with no document. This can happen if a document is being destroyed and random scripts and events are still filtering through the system.
git-svn-id: svn://10.0.0.236/trunk@50585 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:02:02 +00:00
pinkerton%netscape.com
3cadc697e1 correctly update cellmap when scrolling in a tree with no column headers (r=hyatt, partial fix for bug#15771)
git-svn-id: svn://10.0.0.236/trunk@50584 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:01:43 +00:00
waterson%netscape.com
eecbd2d60c Add PR_LOG() calls to aid debugging.
git-svn-id: svn://10.0.0.236/trunk@50583 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:00:45 +00:00
waterson%netscape.com
d69c3be183 Add PR_LOG() calls to aid with debugging.
git-svn-id: svn://10.0.0.236/trunk@50582 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:00:14 +00:00
sfraser%netscape.com
6aa6a226a0 Add jsurl IDL manifest and project for dougt.
git-svn-id: svn://10.0.0.236/trunk@50579 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:19:40 +00:00
dougt%netscape.com
683eda7a2e 1) Now evaluting the script during channel creation rather than read() to
avoid a deadlock between the UI/JS thread and the FileTransport thread.

2) Isolating the proxy of the eval to a single interface

3) Change makefiles for windows and unix.

Brendan asked me to look at this.  I am not sure if there is a bug number.

reviewer=brendan@meer.net


git-svn-id: svn://10.0.0.236/trunk@50578 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:17:36 +00:00
sfraser%netscape.com
057541d810 Part of dougt jsurl changes. Fixing the project to use the _debug prefix file when building debug. r=dougt
git-svn-id: svn://10.0.0.236/trunk@50577 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:16:12 +00:00
sfraser%netscape.com
1359dee773 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50576 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:14:12 +00:00
alecf%netscape.com
fb48c801ad fix windows bustage (sorry, I thought I checked this line in from my windows box, must have missed it)
git-svn-id: svn://10.0.0.236/trunk@50575 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:00:42 +00:00
alecf%netscape.com
252994d3f4 update status
git-svn-id: svn://10.0.0.236/trunk@50574 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:14:58 +00:00
alecf%netscape.com
579a822e8a convert XPFE components over the nsIModules
git-svn-id: svn://10.0.0.236/trunk@50573 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:12:15 +00:00
despotdaemon%netscape.com
17726547ac Pseudo-automatic update of changes made by risto@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@50572 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:07:34 +00:00
alecf%netscape.com
aae40a4d2d nsIModule-ize addressbook
r=sspizer
no bug


git-svn-id: svn://10.0.0.236/trunk@50571 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:55:06 +00:00
alecf%netscape.com
53caf671cb DTDs contain image names too
git-svn-id: svn://10.0.0.236/trunk@50570 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:53:10 +00:00
pavlov%netscape.com
2aaf45465d take 2 static CID's out of two different functions and combine them into 1 r=alecf fixes bug #15776
git-svn-id: svn://10.0.0.236/trunk@50569 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:42:05 +00:00
karnaze%netscape.com
36a43a236d new regression tests, file images for others. Does not affect the build.
git-svn-id: svn://10.0.0.236/trunk@50568 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:40:53 +00:00
alecf%netscape.com
309ba432a9 fix makefiles to correct outdent.dif/outdent.gif typo
git-svn-id: svn://10.0.0.236/trunk@50567 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:35:57 +00:00
alecf%netscape.com
7f72e574c1 add another missing file
git-svn-id: svn://10.0.0.236/trunk@50566 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:34:24 +00:00
sspitzer%netscape.com
e3f84eb9e4 add more comments about what's left to do, and why this is a little scary.
git-svn-id: svn://10.0.0.236/trunk@50565 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:33:26 +00:00
mscott%netscape.com
619a993e2c make sure the user name goes into outgoing imap urls that we make
Bug #16263 --> implement NewURI so we can view embedded images!
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50564 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:21:08 +00:00
mscott%netscape.com
d272bf5abd Bug #16263 --> CreateListOfMessageIDStrings should look for '?' as the delimiter used by
mime for each message part instead of '&'.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50563 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:20:14 +00:00
mscott%netscape.com
fab3227026 Bug #16263 --> make nsGetImapServer public
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50562 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:19:27 +00:00
sspitzer%netscape.com
1caffddc3f whoops, forgot this wee bit of JS.
git-svn-id: svn://10.0.0.236/trunk@50561 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:14:16 +00:00
alecf%netscape.com
dad4df6919 remove file that's making CVS complain
git-svn-id: svn://10.0.0.236/trunk@50560 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:10:14 +00:00
sspitzer%netscape.com
332b7443db fix for #16264, r=mscott. migrate prefs (if we need to) when compose is opened.
also, if we have no identities, launch the account wizard so the user can create
 one.  also, cache the nsIMsgMailSession, we don't need to go through Components
[] and do a getService each time.


git-svn-id: svn://10.0.0.236/trunk@50559 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:09:14 +00:00
alecf%netscape.com
f347f08869 oops, missed this file because of a misspelling
fixes mac and possibly windows breakage


git-svn-id: svn://10.0.0.236/trunk@50558 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:41:11 +00:00
alecf%netscape.com
9083887386 update new image names in all XUL, JS, and CSS
git-svn-id: svn://10.0.0.236/trunk@50556 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:26:01 +00:00
sspitzer%netscape.com
7516584ad9 fix for #16262, r=mscott. now we have "Mozilla Profile Wizard" (a.k.a. -ProfileWizard) for the mac.
git-svn-id: svn://10.0.0.236/trunk@50555 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:21:18 +00:00
vidur%netscape.com
b1974e5540 Fix for bug 15772. Check that a content node is part of the document tree before dispatching a blur event to it. R=joki
git-svn-id: svn://10.0.0.236/trunk@50554 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:19:26 +00:00
alecf%netscape.com
d807cd69da get rid of old poorly cased gif file
git-svn-id: svn://10.0.0.236/trunk@50553 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:18:00 +00:00
alecf%netscape.com
b5cd4ed681 oops, missed this mac file
git-svn-id: svn://10.0.0.236/trunk@50552 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:17:04 +00:00
sspitzer%netscape.com
cb1644bdd6 fix for bug #14591, r=mscott.
handle the case where we migrate from 4.x and our sent folder is on the imap server.
but, since we haven't logged into the imap server yet, our folders are undiscovered.

other related fixes:
1) make it so on failure to fcc, save to draft, save to template, send later the message shows up.
2) clean up the error message strings
3) fix how we determine if an URI points to a local folder. (all we need to do is look at the scheme and see if it is "mailbox:"
4) remove a stale comment.


git-svn-id: svn://10.0.0.236/trunk@50551 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:12:06 +00:00
alecf%netscape.com
e7a07c934b export new gifs on Mac
git-svn-id: svn://10.0.0.236/trunk@50550 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:10:49 +00:00
alecf%netscape.com
4353d33c01 export new images on windows
r=mscott
no bug


git-svn-id: svn://10.0.0.236/trunk@50549 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:09:25 +00:00
alecf%netscape.com
4b07a41a74 export new gifs on unix
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50548 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:08:15 +00:00
alecf%netscape.com
2475291b21 checkin new image file names
not part of build
no reviewer 'cause you can't review images :)
no bug #, just maintenance for skins a la German
all files added with -kb


git-svn-id: svn://10.0.0.236/trunk@50547 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 03:57:13 +00:00
mscott%netscape.com
928088a46d we appeared to be leaking an rdf resource. I fixed this leak by using a nsCOMPtr.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50546 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 03:18:32 +00:00
pollmann%netscape.com
5c5ba7aa15 Bug 16126: Check for a cached state when reading value or submitting Gfx text frame (before initialize); r=joki
git-svn-id: svn://10.0.0.236/trunk@50545 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:49:42 +00:00
mscott%netscape.com
2b381da127 Bug #16115 --> addref the web shell window inside it's Close method to keep the web shell window from getting
deleted out from under us. This could happen because in closing the window, we are destroying a webshell which
could have the last outstanding reference to the webshell window.
r=dp


git-svn-id: svn://10.0.0.236/trunk@50544 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:47:56 +00:00
cathleen%netscape.com
b0844bfd3a update windows packaging file list, bug 16144, r=ssu
git-svn-id: svn://10.0.0.236/trunk@50543 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:20:16 +00:00
pollmann%netscape.com
489f3fc875 Bug 15423: Check for a base href when forming the URL for an image map; r=harishd
git-svn-id: svn://10.0.0.236/trunk@50541 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:37:30 +00:00
valeski%netscape.com
e96f49b91f 16250. r=warren. IOService method name case changed. reflecting the new method names in the directory javascript
git-svn-id: svn://10.0.0.236/trunk@50540 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:36:57 +00:00
davidm%netscape.com
989168e646 8010 [FEATURE] Task Menu | Tools sub-menu items do not work
remove bogus rules
r = hangas


git-svn-id: svn://10.0.0.236/trunk@50539 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:25:39 +00:00
varada%netscape.com
caca355dec correcting temp node problem
git-svn-id: svn://10.0.0.236/trunk@50538 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:19:23 +00:00
mjudge%netscape.com
01e83014a6 bugs 15547,15645,13665,13277,5761, r=akkana,kin,hyatt. fixing selection bugs, keyboard navigation, triple clicking and drag scrolling. get position not a valid call anymore to nsIFrame.h
git-svn-id: svn://10.0.0.236/trunk@50537 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:16:09 +00:00
mjudge%netscape.com
dcd63f4da3 bugs 15547,15645,13665,13277,5761, r=akkana,kin,hyatt. fixing selection bugs, keyboard navigation, triple clicking and drag scrolling.
git-svn-id: svn://10.0.0.236/trunk@50536 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:15:26 +00:00
troy%netscape.com
5132f68d26 b=15509, r=peterl@netscape.com
If the frame has visible content that extends outside its content area,
then the view needs to be marked as having transparent content


git-svn-id: svn://10.0.0.236/trunk@50535 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:02:53 +00:00
pinkerton%netscape.com
9101132f9e removed some visibility/display rules that were already in xul.css. added a workaround for bug #15722 to not change the icons of the scrollbar buttons on rollover, which caused the trees that contained said scrollbars to fully reflow. (r=hyatt).
git-svn-id: svn://10.0.0.236/trunk@50534 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:00:05 +00:00
pollmann%netscape.com
c41e517028 Bug 15180: Don't add a Referer line to the HTTP post data, as Necko already adds one. r=harishd
git-svn-id: svn://10.0.0.236/trunk@50533 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:54:47 +00:00
mgleeson1%netscape.com
fc95d0c6a1 r=dougt need eol for port boxes
git-svn-id: svn://10.0.0.236/trunk@50532 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:50:31 +00:00
rbs%maths.uq.edu.au
6c0a9f5fc0 [MathML] Hooks to allow --enable-mathml
git-svn-id: svn://10.0.0.236/trunk@50531 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:46:09 +00:00
waterson%netscape.com
34e280d8c3 Fix up commentary to reflect reality; remove some confusing stylistic changes. r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50530 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:45:57 +00:00
briano%netscape.com
971976b8c4 Automated update
git-svn-id: svn://10.0.0.236/trunk@50529 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:45:14 +00:00
pinkerton%netscape.com
93aed372f7 pulled mac-specific patches to the tip in order to allow typing in the url bar in navigator to work w/out firing cmd-keybindings. (r=saari, no explicit bug number).
git-svn-id: svn://10.0.0.236/trunk@50528 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:44:43 +00:00
waterson%netscape.com
aa390e05d8 Fix 'commandupdater' nodes; make sure that they are hooked up correctly from the XUL content sink; factor code to appropriately deal with being called from two places. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50527 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:43:46 +00:00
beard%netscape.com
1a22e3ed7e fixing image decoder leak. bug=15380, r=pnunn
git-svn-id: svn://10.0.0.236/trunk@50526 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:41:43 +00:00
rbs%maths.uq.edu.au
1896cfefef [MathML] Assigning @MOZ_MATHML@ to MOZ_MATHML
git-svn-id: svn://10.0.0.236/trunk@50525 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:39:36 +00:00
rbs%maths.uq.edu.au
410ce267d5 [MathML] Update MathML hooks
git-svn-id: svn://10.0.0.236/trunk@50524 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:33:17 +00:00
varada%netscape.com
fcb9e9bf51 fixes for bug #15782 to save caches
git-svn-id: svn://10.0.0.236/trunk@50523 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:28:59 +00:00
varada%netscape.com
37e2169b4e fix for bug #15782 to save cache file in the respective directories and also to save after each page and to save the last used config name in the default che
git-svn-id: svn://10.0.0.236/trunk@50522 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:28:10 +00:00
selmer%netscape.com
2e8166fd64 Added checking to ensure DLL & procedure get loaded successfully
git-svn-id: svn://10.0.0.236/trunk@50521 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:19:03 +00:00
selmer%netscape.com
3f42f06246 Fixed up releasing DLLs in destructor
git-svn-id: svn://10.0.0.236/trunk@50519 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:12:27 +00:00
cbegle%netscape.com
7519f0fc4c * removed stuff from the idl file that caused warnings
* fixed a typo that caused a warning (nsIsupports)
* fixed values of constants that caused warnings
* use a macro instead of assinging a long long value directly

r=jband


git-svn-id: svn://10.0.0.236/trunk@50518 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:11:21 +00:00
pinkerton%netscape.com
7062dc3e8b take a first stab at native system colors. obviously more work needs to be done to use appearance, but this will get us started. (r=sfraser, bug# 1021).
git-svn-id: svn://10.0.0.236/trunk@50517 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:08:17 +00:00
pinkerton%netscape.com
8c90b18f03 correctly trigger the sending of mouse_exit events when the mouse moves into the growBox. fixes a bug with gfx scrollbars in bookmarks when the window was resized. (r=sfraser, no explicit bug number).
git-svn-id: svn://10.0.0.236/trunk@50516 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:06:00 +00:00
selmer%netscape.com
51c5a4e65e Implemented basis for DLL functions in interpreter; fixed Reload to exit if anything follows it
git-svn-id: svn://10.0.0.236/trunk@50515 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:01:10 +00:00
norris%netscape.com
169ef88ab4 Fix following problem:
Subject:
        another getClassLoader exception
   Date:
        Tue, 12 Oct 1999 10:39:26 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




Norris,

It looks like the classes the optimizer generates call
ScriptRuntime.defineFunction which calls getClassLoader.  This throws a
SecurityException.

java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
, Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java,
Compiled Code)
at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled
Code)
at java.lang.Class.getClassLoader(Class.java, Compiled Code)
at
org.mozilla.javascript.ScriptRuntime.defineFunction(ScriptRuntime.java:2045)
at org.mozilla.javascript.gen.c5.initScript(order.js)
at org.mozilla.javascript.gen.c5.exec(order.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:728)
[...]



Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com


git-svn-id: svn://10.0.0.236/trunk@50514 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:54:03 +00:00
despotdaemon%netscape.com
e0c55754d5 Pseudo-automatic update of changes made by dmose@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50513 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:30:12 +00:00
kipp%netscape.com
b7194daf71 r=kin,troy; Fixed reflow bug with optimization logic to avoid measuring text (no bug #)
git-svn-id: svn://10.0.0.236/trunk@50512 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:29:01 +00:00
kipp%netscape.com
01e298fd41 Fixed bugs with combined-area continuing to include trimmed whitespace (wip for 12297); Added support for tracking trim for 16176)
git-svn-id: svn://10.0.0.236/trunk@50511 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:27:32 +00:00
kipp%netscape.com
091955e9a0 New API for bug 16176
git-svn-id: svn://10.0.0.236/trunk@50510 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:26:41 +00:00
kipp%netscape.com
76b98f20a7 Factored common code into a single method (UseComputedHeight)
git-svn-id: svn://10.0.0.236/trunk@50509 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:25:49 +00:00
kipp%netscape.com
51d691cc02 Port to new nsILineIterator api
git-svn-id: svn://10.0.0.236/trunk@50508 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:25:19 +00:00
kipp%netscape.com
45e857d860 Fixed bug with bounds of line-box including side margins when it shouldn't (part of 12297)
git-svn-id: svn://10.0.0.236/trunk@50507 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:24:51 +00:00
kipp%netscape.com
28bd74e177 r=troy; Cleaned up line-box API (prep work for bug #12297; more coming); Support new line iterator API change (#16176)
git-svn-id: svn://10.0.0.236/trunk@50505 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:24:22 +00:00
kipp%netscape.com
eb73055cf6 Removed silly NS_IMETHOD decls
git-svn-id: svn://10.0.0.236/trunk@50504 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:22:53 +00:00
kipp%netscape.com
2c17cc458b Added two new atoms to help meter large vs. small line boxes
git-svn-id: svn://10.0.0.236/trunk@50503 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:22:34 +00:00
kipp%netscape.com
d10b7ecd53 Removed two warnings
git-svn-id: svn://10.0.0.236/trunk@50502 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:21:40 +00:00
kipp%netscape.com
028e053c7f new
git-svn-id: svn://10.0.0.236/trunk@50501 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:20:40 +00:00
rjc%netscape.com
252f4090ad Fix VC5 build bustage.
git-svn-id: svn://10.0.0.236/trunk@50500 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:09:09 +00:00
idk%eng.sun.com
9599670719 Fix 16230
Call AddRef for newly created PlugletInsance
r = akhil.arora@sun.com


git-svn-id: svn://10.0.0.236/trunk@50499 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:01:44 +00:00
terry%mozilla.org
100e540599 Patch by Holger Schurig <holger@holger.om.org> -- rewriting and enhancing the
ability to edit components, products, and versions.  Yay!


git-svn-id: svn://10.0.0.236/trunk@50498 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:00:35 +00:00
mgleeson1%netscape.com
b383080e9b r=evaughan friend declaration needs to declare object is function or class (HPUX)
git-svn-id: svn://10.0.0.236/trunk@50497 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:58:04 +00:00
norris%netscape.com
f40460044c Fix 7254 Implement DOM security
Reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50496 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:55:25 +00:00
pavlov%netscape.com
967990a454 build nsScriptableRegion.cpp on windows and linux r=pinkerton ********* WORK TO FIX BUG 12465 *********
git-svn-id: svn://10.0.0.236/trunk@50495 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:53:41 +00:00
norris%netscape.com
120ec26f3b Work on 15824 bad refcounting in nsCodebasePrincipal
Attempt to discover problem with additional assertions
reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50494 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:52:49 +00:00
norris%netscape.com
f686bba5d8 Fix part of 5403 Services improperly released: Use NS_WITH_SERVICE
reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50493 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:51:54 +00:00
norris%netscape.com
1d1cd2baaf Fix unix build warning.
Reviewed by rogerl@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50492 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:48:17 +00:00
dougt%netscape.com
b6030ceac7 adding default constructor (mac compiler blues)
git-svn-id: svn://10.0.0.236/trunk@50491 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:47:50 +00:00
norris%netscape.com
258a2a6d4a Needed for 7254: Implement DOM security
reviewed by Ben Goodger <rgoodger@ihug.co.nz> and Seth Spitzer <sspitzer@netscape.com>

Scripts running from chrome are considered super privileged and can perform operations that
scripts from the web cannot. I differentiate chrome scripts from web
scripts by considering all scripts loaded from chrome: URIs to be
privileged.

The problem I'm running into is that the loading of relative urls in
this code ends up going to the file: protocol (which is what the chrome
protocol is converted to internally). This change makes sure we load
from the chrome protocol so that the scripts are privileged and don't
get access errors. It's probably a good idea to load from the chrome
protocol anyway since it may one day be resolved to extracting from a
JAR file rather than accessing a discrete file.


git-svn-id: svn://10.0.0.236/trunk@50490 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:47:36 +00:00
dougt%netscape.com
2f38d972f2 adding default constructor (mac compilers blues)
git-svn-id: svn://10.0.0.236/trunk@50489 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:46:49 +00:00
kmcclusk%netscape.com
afe30290c8 Set state of checkbox and Radio button on MouseUp instead of MouseDown so JavaScript onclick
event handlers can retreive the correct state of the form element. bug 15366; r=rods@netscape.com

Submit the form when a text field is clicked on only if the JavaScript event handler
has not consumed the event. bug 15949; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50488 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:44:23 +00:00
wtc%netscape.com
19cd8f1747 Backed out previous revision, which was checked in during code freeze.
git-svn-id: svn://10.0.0.236/trunk@50486 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:37:13 +00:00
cyeh%netscape.com
3ee2fa81c3 add support for megahal conversation ai, fix syntax error for sending
stock reports to the original requestor.


git-svn-id: svn://10.0.0.236/trunk@50485 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:34:49 +00:00
dougt%netscape.com
2ebb109791 changing the entrypoint to call another constructor. I need this since I have
removed an unneeded constructor.  related bug 13724. r=brendan@meer.net


git-svn-id: svn://10.0.0.236/trunk@50484 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:32:10 +00:00
dougt%netscape.com
8344cba9ee Added a nested event loop instead of blocking during sync calls. Partial fix
for bug 13724.  (I still must remove ifdef's for the autoproxy code.)
r=brendan@meer.net.


git-svn-id: svn://10.0.0.236/trunk@50483 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:29:43 +00:00
rjc%netscape.com
7c82b0b5f1 [performance] When profile manager is being used, don't read in bookmarks twice... by deferring hiddenwindow.xul loading until after profile manager is done. Review: danm and sspitzer
git-svn-id: svn://10.0.0.236/trunk@50482 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:20:28 +00:00
kmcclusk%netscape.com
1f838ed9cc Backing out change made while tree was closed
git-svn-id: svn://10.0.0.236/trunk@50481 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:07:24 +00:00
kmcclusk%netscape.com
288ad892dc Backing out changes made while tree was closed.
git-svn-id: svn://10.0.0.236/trunk@50480 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:01:49 +00:00
norris%netscape.com
0067ebd9f5 Remove redundant import.
git-svn-id: svn://10.0.0.236/trunk@50479 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 21:46:50 +00:00
kmcclusk%netscape.com
3ed94d5f1f Set state of checkbox and Radio button on MouseUp instead of MouseDown so JavaScript onclick
event handlers can retreive the correct state of the form element. bug 15366; r=rods@netscape.com

Submit the form when a text field is clicked on only if the JavaScript event handler
has not consumed the event. bug 15949; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50478 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 21:42:31 +00:00
evaughan%netscape.com
74de522d21 Fixed mail/news regression. Code review Saari, Hyatt
git-svn-id: svn://10.0.0.236/trunk@50476 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:50:01 +00:00
selmer%netscape.com
318689d640 Top level makefile
git-svn-id: svn://10.0.0.236/trunk@50474 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:36:42 +00:00
terry%mozilla.org
06a85f06f3 Patch by Holger Schurig <holger@holger.om.org> -- If there is no exactly ONE
user in the profiles table, then this user will be promoted into all groups.


git-svn-id: svn://10.0.0.236/trunk@50473 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:28:41 +00:00
beard%netscape.com
fa0386eb21 printing stack crawls with LXR URLs.
git-svn-id: svn://10.0.0.236/trunk@50472 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:59:52 +00:00
dmose%mozilla.org
980b8b883b not used on the trunk; the space in the file name is causing script problems. r=smfr@netscape.com, a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@50471 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:32:04 +00:00
selmer%netscape.com
b237b4f45e Split interpret into its own class
git-svn-id: svn://10.0.0.236/trunk@50470 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:31:05 +00:00
terry%mozilla.org
e5bf02a97b newer alphas of MySQL won't let use "when" as a column name, so let's change
our usage while it's still easy to do so.


git-svn-id: svn://10.0.0.236/trunk@50469 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:05:42 +00:00
slamm%netscape.com
ffbff9e7c8 Forgot a semicolon and that caused the creation of bogus files. a=leaf. Thanks to jim_nance@yahoo.com for pointing out the problem.
git-svn-id: svn://10.0.0.236/trunk@50468 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 17:05:05 +00:00
terry%mozilla.org
f07d66246d Patch by Holger Schurig <holgerschurig@nikocity.de> -- replace all the
yicky old make*.sh files and the CHANGES file with a new, nifty
checksetup.pl file that knows how to create a setup from scratch as
well as upgrade an older setup to a new one.  Very cool stuff!


git-svn-id: svn://10.0.0.236/trunk@50467 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:58:11 +00:00
terry%mozilla.org
6c6ce1b3d7 Patch by tom@platte.com (Tom Schutter) -- wasn't working if no groups
had isbuggroup set.


git-svn-id: svn://10.0.0.236/trunk@50466 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:52:25 +00:00
norris%netscape.com
c813db9f21 Fix release date, add contributor.
git-svn-id: svn://10.0.0.236/trunk@50465 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:52:13 +00:00
karnaze%netscape.com
eb1e3503ae new regression test.
git-svn-id: svn://10.0.0.236/trunk@50464 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 14:50:38 +00:00
Jerry.Kirk%Nexwarecorp.com
f62900eb59 Fixed syntax error which caused invalidation not to work when logging
was turned off.
Bug# 16169 r=Dale.Stansberry@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50463 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 14:39:32 +00:00
neeti%netscape.com
0e926140f9 updating status
git-svn-id: svn://10.0.0.236/trunk@50462 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:38:23 +00:00
neeti%netscape.com
639989c1df Converted to nsIModule to prepare for memory leaks fixing. Bug# 14034. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50461 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:33:42 +00:00
dcone%netscape.com
78accf0d1a fixed the CreateRenderingContext call in nsDeviceContext to get rid of warnings. CR by KMcclusk.
git-svn-id: svn://10.0.0.236/trunk@50460 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:32:34 +00:00
briano%netscape.com
d7505330dd Automated update
git-svn-id: svn://10.0.0.236/trunk@50459 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 12:52:20 +00:00
cls%seawood.org
b166fe020d Converting patches applied for bug 15241 into a build option, --enable-implicit-archive, that is off by default.
r=syd


git-svn-id: svn://10.0.0.236/trunk@50458 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 12:36:07 +00:00
briano%netscape.com
55f10b405f Automated update
git-svn-id: svn://10.0.0.236/trunk@50457 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:52:18 +00:00
ramiro%netscape.com
8bcbaf642c Fix for bug 16163. Usage of -liberty to demangle symbols breaks on loser
linux distributions.  I changed configure.in to detect this lib before using
it.  You can stop whinning now thank you.  r=syd@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50456 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:42:56 +00:00
warren%netscape.com
a5420e53d5 Fixed nsnull problem!
git-svn-id: svn://10.0.0.236/trunk@50455 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:21:26 +00:00
terry%mozilla.org
611923e583 Updating the vote cache should not update the date-last-changed field
in the bug.


git-svn-id: svn://10.0.0.236/trunk@50454 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:18:29 +00:00
warren%netscape.com
4e84b82b51 Fixed return value for non-debug builds.
git-svn-id: svn://10.0.0.236/trunk@50453 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 10:27:40 +00:00
warren%netscape.com
865a79a1b5 Added Bloat statistics under QA menu.
git-svn-id: svn://10.0.0.236/trunk@50452 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:37:37 +00:00
warren%netscape.com
5e7fed7a2f Added about:bloat
git-svn-id: svn://10.0.0.236/trunk@50451 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:35:22 +00:00
warren%netscape.com
ed816f5fa6 added files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50450 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:32:18 +00:00
warren%netscape.com
da470df1ca Added nsTraceRefcnt logging.
git-svn-id: svn://10.0.0.236/trunk@50449 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:30:16 +00:00
warren%netscape.com
4ff5cdca2a Made nsTraceRefcnt output write to streams.
git-svn-id: svn://10.0.0.236/trunk@50448 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:30:12 +00:00
warren%netscape.com
991d518e3e removed files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50447 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:26:38 +00:00
warren%netscape.com
d8984b315e added files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50446 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:25:14 +00:00
warren%netscape.com
c5fccc649e Added about:bloat handler.
git-svn-id: svn://10.0.0.236/trunk@50445 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:20:25 +00:00
pollmann%netscape.com
419cb327c4 Bug 15841: Don't default to selecting item 0 of a listbox
Bug 15769: Default select item 0 when adding or removing opt to combo
r=harishd


git-svn-id: svn://10.0.0.236/trunk@50444 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 08:47:29 +00:00
pollmann%netscape.com
7860787b10 Bug 15769: Default select item 0 when adding or removing opt to combo
r=harishd


git-svn-id: svn://10.0.0.236/trunk@50443 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 08:47:22 +00:00
mscott%netscape.com
ccf37b21ec Remove this file from the repository to fix the Mac buids.
The mac projects were looking in this folder and always finding the
stale nsISessionHistory.h file instead of using the idl generated
header file
r=davidm


git-svn-id: svn://10.0.0.236/trunk@50442 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 07:50:17 +00:00
mcafee%netscape.com
0ba95a928f Applying patch from buhr@stat.wisc.edu. Fixes destination widget confusion (14759). Unix-only, a=mscott
git-svn-id: svn://10.0.0.236/trunk@50441 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 07:26:47 +00:00
radha%netscape.com
569c87328e Build bustage in solaris
git-svn-id: svn://10.0.0.236/trunk@50440 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:57:03 +00:00
mscott%netscape.com
941d2435ba nsISessionHistory.idl needs to be in this project.
i think this should fix Radha' build breakage for the mac.


git-svn-id: svn://10.0.0.236/trunk@50439 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:45:10 +00:00
mcafee%netscape.com
68944c6b5c Adding debug Pref UI for evaughan's gfx scrollbars. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50438 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:40:15 +00:00
sfraser%netscape.com
1122546a7f Fix for bug 16151; make the file transport working thread stack size 64k, instead of 8k. Fixes crashes on startup on Mac. r=beard
git-svn-id: svn://10.0.0.236/trunk@50437 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:39:18 +00:00
jefft%netscape.com
b77b7f8e29 removed files: mozilla/mailnews/compose/src/nsMsgI18N.cpp
git-svn-id: svn://10.0.0.236/trunk@50436 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:24:48 +00:00
jefft%netscape.com
1eb33cb46e added files: mozilla/mailnews/base/util/nsMsgI18N.cpp
git-svn-id: svn://10.0.0.236/trunk@50435 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:21:21 +00:00
jefft%netscape.com
c0fbb70022 fixed bug 15676 - Display problem in Subject header with non-ascii when Forwarding; decode the subject string based on character prior setting it to nsMsgComposeFields; move nsMsgI18N.h, nsMsgI18N.cpp from compose/src to base/util; r=rhp, nhotta
git-svn-id: svn://10.0.0.236/trunk@50434 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:18:27 +00:00
mscott%netscape.com
ec97378850 Bug #15655 --> don't build old nsMimeFactory. Build nsMimeModule instead.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50433 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:05:17 +00:00
mscott%netscape.com
df2bf72c59 Bug #15655 -> build nsMimeModule.cp
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50432 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:04:41 +00:00
mscott%netscape.com
7527b7b206 bug #15655 --> no longer build nsMimeFactory.cpp...we build
nsMimeModule instead.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50431 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:04:25 +00:00
mscott%netscape.com
a252dee761 include nsMsgMimeCID.h to get the CID. (moved CID out of interface)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50430 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:49 +00:00
mscott%netscape.com
05ab0a848d Bug #15655 module for mime. (replaces nsMimeFactory.cpp)
remove NS_New** factory method. minor cleanup
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50429 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:25 +00:00
mscott%netscape.com
d0cd134272 Bug #15655 module for mime. (replaces nsMimeFactory.cpp)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50428 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:05 +00:00
mscott%netscape.com
e89f59cad5 Bug #15655 new file. module for mime. (replaces nsMimeFactory.cpp)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50427 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:02:23 +00:00
rbs%maths.uq.edu.au
dd050726f8 [MathML] Updates and initial landing of the example mixing.xml to illustrate how to mix MathML with other markups
git-svn-id: svn://10.0.0.236/trunk@50426 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:00:32 +00:00
rbs%maths.uq.edu.au
02f74ae132 [MathML] Removing unecessary #include of header files
git-svn-id: svn://10.0.0.236/trunk@50425 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:53:41 +00:00
rbs%maths.uq.edu.au
a017529e6b [MathML] Additional missing hooks
git-svn-id: svn://10.0.0.236/trunk@50424 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:47:55 +00:00
rbs%maths.uq.edu.au
7083308cff [MathML] Removing unecessary #include of header files
git-svn-id: svn://10.0.0.236/trunk@50423 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:42:15 +00:00
waterson%netscape.com
6430228b19 Add nsScrollPortView.cpp to the build to get around undefined symbols at startup: looks like it got missed on Unix.
git-svn-id: svn://10.0.0.236/trunk@50422 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:41:07 +00:00
radha%netscape.com
7ba4c213b3 XPIDLising session history. bug # 15437. r=law
git-svn-id: svn://10.0.0.236/trunk@50421 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:40:59 +00:00
rbs%maths.uq.edu.au
84470b2c93 [MathML] Portability: adding explicit get() on pointers coming from nsCOMPtr
git-svn-id: svn://10.0.0.236/trunk@50420 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:38:21 +00:00
radha%netscape.com
270ce881b4 XPIDised session history. Corresponding changes to users of nsISessionHistory.
Bug # 15437. r=law


git-svn-id: svn://10.0.0.236/trunk@50419 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:37:43 +00:00
cls%seawood.org
173cc583c1 Temp fix for the dependency problem caused by the use of implicit shared libs. a=leaf
git-svn-id: svn://10.0.0.236/trunk@50418 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:42:02 +00:00
idk%eng.sun.com
651e1ddd8a Bug <a href=http://bugzilla.mozilla.org/show_bug.cgi?id=15892> 15892 </a>
increment pointer to  mime description string before calling strchr


git-svn-id: svn://10.0.0.236/trunk@50417 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:29:27 +00:00
waterson%netscape.com
30e53d03e9 Bug 16105. (Bugsplat 366256.) Ensure that nsISupports::Release() calls dtor only once by 'stabilizing' refcnt to a non-zero value before invoking the dtor. See also news://news.mozilla.org/37FD0F3C.3078AE5C%40netscape.com. r=scc,fur
git-svn-id: svn://10.0.0.236/trunk@50416 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:05:10 +00:00
warren%netscape.com
0a71bb415f Fixed missed GetFileSpec
git-svn-id: svn://10.0.0.236/trunk@50415 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:35:00 +00:00
rbs%maths.uq.edu.au
daf51ae193 Revamp of the architecture for stretchy symbols so that nsMathMLChar only deals with the atomic stretchy task.
git-svn-id: svn://10.0.0.236/trunk@50414 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:12:36 +00:00
waterson%netscape.com
e20da712ec Bug 16105. (Bugsplat 366256.) Ensure that nsISupports::Release() calls dtor only once by 'stabilizing' refcnt to a non-zero value before invoking the dtor. See also news://news.mozilla.org/37FD0F3C.3078AE5C%40netscape.com. r=scc,fur
git-svn-id: svn://10.0.0.236/trunk@50413 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:10:08 +00:00
alecf%netscape.com
a4d81273ff upating status
git-svn-id: svn://10.0.0.236/trunk@50412 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:07:13 +00:00
rbs%maths.uq.edu.au
931605d622 Removing a duplicate reference to a src file
git-svn-id: svn://10.0.0.236/trunk@50411 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:06:05 +00:00
rbs%maths.uq.edu.au
ba241132ea Removing a typedef and adding a new NS_MATHML_OPERATOR_MUTABLE flag
git-svn-id: svn://10.0.0.236/trunk@50409 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:58:27 +00:00
selmer%netscape.com
36bb330940 Created new Interpret.cpp & CInterpret class
git-svn-id: svn://10.0.0.236/trunk@50408 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:54:00 +00:00
rbs%maths.uq.edu.au
328d62f08f [MathML] removing registration hooks. They are now handled by nsLayoutModule.
git-svn-id: svn://10.0.0.236/trunk@50407 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:48:05 +00:00
warren%netscape.com
6a952509ef Lowercased idl method names for scriptability. Cleaned up nsIURL interface.
git-svn-id: svn://10.0.0.236/trunk@50406 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:39:37 +00:00
peterl%netscape.com
3295631735 store system colors as int rather than enums
return proper result code when setting system color
r=rods


git-svn-id: svn://10.0.0.236/trunk@50405 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:31:33 +00:00
slamm%netscape.com
f12855c796 Remove extra 'mozilla/' in cvsblame'd source link.
git-svn-id: svn://10.0.0.236/trunk@50404 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:25:47 +00:00
rbs%maths.uq.edu.au
121acfa205 [MathML] Setting a bolean to PR_TRUE to allow generated pseudo content (e.g., :before, :after) in MathML.
git-svn-id: svn://10.0.0.236/trunk@50403 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:19:34 +00:00
cathleen%netscape.com
01eb918031 fix mac packager list, bug 16141, r=ssu
git-svn-id: svn://10.0.0.236/trunk@50402 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:11:42 +00:00
selmer%netscape.com
63d606d58f Fix up inclusions of headers
git-svn-id: svn://10.0.0.236/trunk@50401 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:56:51 +00:00
pavlov%netscape.com
8f331211d9 fix cursor blinking on linux r=ramiro
git-svn-id: svn://10.0.0.236/trunk@50400 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:44:07 +00:00
alecf%netscape.com
e2e17b4ff5 finish landing nsIModule for compose
this and my last checkin r=sspizter
no bug, porkjockey work


git-svn-id: svn://10.0.0.236/trunk@50399 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:37:39 +00:00
alecf%netscape.com
d5785373e3 land nsIModule for mail compose
git-svn-id: svn://10.0.0.236/trunk@50398 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:34:06 +00:00
peterl%netscape.com
1299fd6c0b better result code testing in recreate frames for content
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50397 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:32:13 +00:00
peterl%netscape.com
7021f197de added ignore value to user-focus
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50396 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:30:54 +00:00
peterl%netscape.com
df37832d89 added 'ignore' keyword
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50395 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:30:19 +00:00
warren%netscape.com
6d83d361f0 Fixed bloat snapshotting capabilities. r=kipp
git-svn-id: svn://10.0.0.236/trunk@50394 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:29:54 +00:00
warren%netscape.com
93c11dbc7d Added NS_LOG_RELEASE for bloat stats. r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50393 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:28:14 +00:00
ssu%netscape.com
6a84236160 fixing bug #16095. apprunner.exe got renamed to mozilla.exe. This fix updates the installer to create the proper windows shortcut. Not part of tinderbox. r=dbragg@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50392 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:23:37 +00:00
peterl%netscape.com
8b985c46d4 fix return type for append reflow command (was returning PRBool for nsresult)
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50391 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:23:10 +00:00
peterl%netscape.com
bd0a1b5cb4 dont strip multiple changes with nsnull frames
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50390 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:22:18 +00:00
peterl%netscape.com
b765a3d4c4 add 'ignore' to user focus
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50389 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:21:06 +00:00
dougt%netscape.com
06ac17fb62 fixes bug 15709. r=dveditz.
git-svn-id: svn://10.0.0.236/trunk@50388 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:20:23 +00:00
evaughan%netscape.com
4dbf02b9bd added files: mozilla/view/src/nsScrollPortView.cpp
git-svn-id: svn://10.0.0.236/trunk@50387 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:34 +00:00
sspitzer%netscape.com
da4d6e495b fix for #16098, r=mscott. Now we have "Mozilla Profile Manager" for the mac, which is the same as -ProfileManager on the other platforms
git-svn-id: svn://10.0.0.236/trunk@50386 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:31 +00:00
evaughan%netscape.com
b6c93b5c5c Integrated Gfx scrollbars.
git-svn-id: svn://10.0.0.236/trunk@50385 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:06 +00:00
mscott%netscape.com
6d6b3023f8 support nsIStreamObserver to get rid of an assert in necko.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50384 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:13:45 +00:00
cbegle%netscape.com
d31b3296a7 new files.
new tests for xpconnect.  r=jband.


git-svn-id: svn://10.0.0.236/trunk@50383 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:12:43 +00:00
varada%netscape.com
bb0622beb7 changing minlen and maxlen in edit fields
git-svn-id: svn://10.0.0.236/trunk@50382 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:12:10 +00:00
alecf%netscape.com
342865f5fe was not setting the "type" attribute during CreateIncomingServer
fixes #16075
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50381 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:07:14 +00:00
varada%netscape.com
e6f4dfa6bc bug #5958 validating entering of characters in the newconfigdialog edit fields
git-svn-id: svn://10.0.0.236/trunk@50380 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:05:38 +00:00
kmcclusk%netscape.com
f52acaed14 Implemented nsRenderingContextWin::CopyClipRegion. bug 13913; r=rods@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50379 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:05:04 +00:00
ducarroz%netscape.com
888a71ee23 Fix for bug 15235 & 14785. I checkin this for jefft. Messages need to be save using platform specific line break. R=ducarroz
git-svn-id: svn://10.0.0.236/trunk@50378 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:03:17 +00:00
kmcclusk%netscape.com
90932ba7f3 Changed WIN32 windows style from WS_EX_CLIENTEDGEto WS_EX_WINDOWEDGE to
stop drawing client windows sunken. bug=15151; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50377 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:56:55 +00:00
rods%netscape.com
b845870367 changed fonts for select and optgroup to match r=kmcclusk b=12230
git-svn-id: svn://10.0.0.236/trunk@50376 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:48:41 +00:00
varada%netscape.com
c3b9e376e5 fix to bug #15339- added SetForegroundWindowin the OnSetActive code in the wizardui.cpp
git-svn-id: svn://10.0.0.236/trunk@50375 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:47:49 +00:00
nhotta%netscape.com
59ee43f7fc Adding a new interface which does a charset conversion plus NE and NCR for fallback. Part of bug fix #8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50374 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:47:27 +00:00
rods%netscape.com
a30fed502d removed css system color references (not implemented on Mac yet)
changed all checkbox borders to 2 pixels r=kmcclusk b=13854


git-svn-id: svn://10.0.0.236/trunk@50373 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:44:36 +00:00
nisheeth%netscape.com
d65bc1efa0 We now use the new RAPTOR_STOPWATCH_DEBUGTRACE macro to annotate all manipulations of the timers.
git-svn-id: svn://10.0.0.236/trunk@50372 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:42:56 +00:00
nisheeth%netscape.com
932343b896 Changes not part of build. We now use the new RAPTOR_STOPWATCH_DEBUGTRACE macro to annotate all manipulations of the timers.
git-svn-id: svn://10.0.0.236/trunk@50371 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:33:14 +00:00
nisheeth%netscape.com
4443e74058 Changes not part of build. Added a debug trace macro that outputs to the console only when DEBUG_STOPWATCH is defined.
git-svn-id: svn://10.0.0.236/trunk@50370 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:30:45 +00:00
rogerl%netscape.com
9a868467c2 NOT A PART OF SEAMONKEY BUILD
- fixed test ECMA references,
- added test to -002


git-svn-id: svn://10.0.0.236/trunk@50368 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 22:59:25 +00:00
norris%netscape.com
6a9e7e63c8 Fix bug:
Subject:
        optimizer SecurityException
   Date:
        Mon, 11 Oct 1999 17:37:51 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




We use our own SecuritySupport implementation in Rhino.  This is properly
getting called by the optimizer to generate new classes (e.g.
org.mozilla.javascript.gen.c5 etc.)

However, after defining the class, Codegen.compile calls getClassLoader()
on the new class.  The default SecurityManager doesn't allow
getClassLoader() to be called and so an exception is thrown:

java.lang.RuntimeException: Malformed optimizer package
java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
        at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:138)
        at org.mozilla.javascript.Context.compile(Context.java:1761)
        at org.mozilla.javascript.Context.compile(Context.java:1691)
        at org.mozilla.javascript.Context.compileReader(Context.java:810)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
        [...]

This is kind of a pain to duplicate outside of our application, but if you
require a test case I can create one.

Codegen is attempting to call loadClass() after it uses
SecuritySupport.defineClass().  Our SecuritySupport calls loadClass()
internally in its defineClass() implementation.  This is what JavaAdapter
expects.

This is from Codegen.compile():

                         if (securitySupport == null) {
                             if (Context.isSecurityDomainRequired())
                                 throw new SecurityException("Required " +
                                             "security context missing");
                             if (classLoader == null)
                                 classLoader = new JavaScriptClassLoader();
                             clazz = classLoader.defineClass(name, classFile);
                         } else {
                             clazz = securitySupport.defineClass(name,
classFile,
                                                                 securityDom
securityDomain);
                         }
                         ClassLoader loader = clazz.getClassLoader();
                         clazz = loader.loadClass(name);


This is from JavaAdapter.createAdapterClass():


         SecuritySupport ss = cx.getSecuritySupport();
         if (ss != null)  {
             Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
             return ss.defineClass(adapterName, bytes, securityDomain);
         } else {
             if (classLoader == null)
                 classLoader = new MyClassLoader();
             classLoader.defineClass(adapterName, bytes);
             return classLoader.loadClass(adapterName, true);
         }


So JavaAdapter is assuming SecuritySupport.defineClass() will call
ClassLoader.loadClass() on the new class, while Codegen is assuming it
needs to call ClassLoader.loadClass() on the class defined by
SecuritySupport.defineClass().

These should be made consistent, and in both cases it should be assumed
that SecuritySupport will both define and load the class.


Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com


git-svn-id: svn://10.0.0.236/trunk@50367 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 22:48:13 +00:00
rogerl%netscape.com
2fc190da13 NOT A PART OF SEAMONKEY BUILD
- removed redundant test & fixed test for 'super' to detect syntax error


git-svn-id: svn://10.0.0.236/trunk@50366 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 22:38:40 +00:00
varada%netscape.com
d6fa660ea6 #6569 adding Message function to OnNext handler
git-svn-id: svn://10.0.0.236/trunk@50365 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 22:30:02 +00:00
varada%netscape.com
2c4f182411 #15327 changing minlen to maxlen
git-svn-id: svn://10.0.0.236/trunk@50364 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 22:28:59 +00:00
sfraser%netscape.com
159030e89c Part of fix for 15795; nsFileSpecMac.cpp is no longer pulled in with a nasty #include, and is thus added to the project. r=dougt
git-svn-id: svn://10.0.0.236/trunk@50362 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 21:19:47 +00:00
terry%mozilla.org
c140cc2ce4 Got rid of silly debugging hack.
git-svn-id: svn://10.0.0.236/trunk@50361 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 21:19:46 +00:00
sfraser%netscape.com
8023b08ebc Fix for bugs 15795 and 16090 -- fix startup crash which was due to an uninitialized nsFileSpec trashing the stack. Also no longer set mError on CreateDirectory if the dir already exists, prevent += "foo" when mError is set, and add assertions XP to catch calls with NULL strings.
reviewed by dougt and (in part) sspitzer. a=leaf.


git-svn-id: svn://10.0.0.236/trunk@50360 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 21:19:06 +00:00
terry%mozilla.org
c90da152c8 Sort votes in decreasing order, not increasing.
git-svn-id: svn://10.0.0.236/trunk@50359 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 21:17:17 +00:00
leaf%mozilla.org
f9f813ef1c removing multiple include of mozilla/silentdl from raptor modules
git-svn-id: svn://10.0.0.236/trunk@50357 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:48:28 +00:00
slamm%netscape.com
8fad354f5e Remove '-test' from output file name
git-svn-id: svn://10.0.0.236/trunk@50356 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:46:59 +00:00
slamm%netscape.com
9a58260a6e finished testing
git-svn-id: svn://10.0.0.236/trunk@50355 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:43:46 +00:00
slamm%netscape.com
d1bd5d5e97 New file indexing. Use '/cvsroot' instead of lxr index.
git-svn-id: svn://10.0.0.236/trunk@50354 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:42:53 +00:00
slamm%netscape.com
ea86098377 Skip attic files.
git-svn-id: svn://10.0.0.236/trunk@50353 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:40:51 +00:00
slamm%netscape.com
dcfe02ab7b slight tweak. take 2.
git-svn-id: svn://10.0.0.236/trunk@50352 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:37:32 +00:00
slamm%netscape.com
cb5728cc3b slight tweak
git-svn-id: svn://10.0.0.236/trunk@50351 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:36:12 +00:00
slamm%netscape.com
1a57622faf Need to account for ,v
git-svn-id: svn://10.0.0.236/trunk@50350 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:34:57 +00:00
slamm%netscape.com
5bfc12b38e Test new file indexing.
git-svn-id: svn://10.0.0.236/trunk@50349 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:26:38 +00:00
varada%netscape.com
fb01047518 checking in fixes for bug #6569 - confirmation on clicking the finish button
git-svn-id: svn://10.0.0.236/trunk@50348 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:23:25 +00:00
terry%mozilla.org
a8e3ac3d29 Let's not keep everything locked up while regenerating.
git-svn-id: svn://10.0.0.236/trunk@50347 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 19:02:49 +00:00
terry%mozilla.org
8d648e06d7 Stop reporting "area"; don't report voters on the CC line.
git-svn-id: svn://10.0.0.236/trunk@50346 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 18:54:45 +00:00
terry%mozilla.org
c49588441a Make "rescanall" only check bugs which have changed in the last two days.
git-svn-id: svn://10.0.0.236/trunk@50345 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 18:23:21 +00:00
terry%mozilla.org
d9793670d5 Added ability to run "processmail rescanall" to scan *every* bug for
any mail that ought to be sent to someone.


git-svn-id: svn://10.0.0.236/trunk@50344 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 18:18:39 +00:00
terry%mozilla.org
865140e021 Oops; need extra directions to avoid problems when removing the "area" column.
git-svn-id: svn://10.0.0.236/trunk@50343 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 17:41:47 +00:00
terry%mozilla.org
6e44e98669 Stupid hack to let things work with people who have bookmarked
vote-sorting URLs using the old style.


git-svn-id: svn://10.0.0.236/trunk@50342 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 17:21:18 +00:00
terry%mozilla.org
97ae527556 Added a "votes" field to the bugs table, which caches the total number
of votes that have been cast for that bug.  This let me simplify the
SQL in buglist.cgi, which makes things more efficient and fixes
several strange bugs.


git-svn-id: svn://10.0.0.236/trunk@50341 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 17:14:32 +00:00
kipp%netscape.com
c2c9a9c0b6 Updated documentation to be more accurate; provided description of command line arguments
git-svn-id: svn://10.0.0.236/trunk@50340 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 15:30:17 +00:00
Jerry.Kirk%Nexwarecorp.com
058528945e Adding a "; else true" to work around broken shell under QNX4 for the
Neutrino cross-compile.
Bug #16049 r=Dale.Stansberry@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50339 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 14:41:25 +00:00
neeti%netscape.com
b3d531541b updating status
git-svn-id: svn://10.0.0.236/trunk@50338 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 14:17:18 +00:00
briano%netscape.com
f52490e687 Automated update
git-svn-id: svn://10.0.0.236/trunk@50337 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 11:16:05 +00:00
briano%netscape.com
16ba6581af Automated update
git-svn-id: svn://10.0.0.236/trunk@50336 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 11:07:20 +00:00
ramiro%netscape.com
7fe99209ab Fix for bug 13522. Duplicate nsTimer.cpp files. Removing the old ones.
r=pavlov@netscape.com,sfraser@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50335 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 04:01:35 +00:00
ramiro%netscape.com
64aa89c32a Fix for bug 13522. Duplicate nsITimer.h files. Removing the old ones.
r=pavlov@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50334 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 03:48:21 +00:00
pavlov%netscape.com
770be8200a Do not draw images if we have an empty clip region r=syd fixes bug #11086
git-svn-id: svn://10.0.0.236/trunk@50333 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 03:04:59 +00:00
mcafee%netscape.com
574bed9e24 Enable Solaris/Intel/egcs to build & run. Patch submitted by Roy Jones, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@50332 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 23:41:23 +00:00
putterman%netscape.com
d468916c06 Remove ctor/dtor counter macros I added before it was determined we shouldn't
use them for xpcom classes.


git-svn-id: svn://10.0.0.236/trunk@50331 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 22:52:49 +00:00
putterman%netscape.com
9dbd192f71 Use ctor/dtor counter macros on non xpcom classes. reviewed by mscott. no bug.
git-svn-id: svn://10.0.0.236/trunk@50330 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 22:32:54 +00:00
putterman%netscape.com
e618bdbebb Switch over mailnews/base to use nsIModule. I forgot to mention that these
checkins were reviewed by mscott.  There's no bug.


git-svn-id: svn://10.0.0.236/trunk@50329 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 22:32:25 +00:00
putterman%netscape.com
7f3afb38db Switch over mailnews/base to use nsIModule.
git-svn-id: svn://10.0.0.236/trunk@50328 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 22:31:48 +00:00
putterman%netscape.com
1ef39b7b56 Create a version of NS_GENERIC_FACTORY_CONSTRUCTOR that lets you pass in
an initialization function.  No bug.  Reviewed by dp.


git-svn-id: svn://10.0.0.236/trunk@50327 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 22:30:55 +00:00
ramiro%netscape.com
a29fb3f1d9 Add .*.timestamp to ignore the new "ar" hack droppings.
git-svn-id: svn://10.0.0.236/trunk@50326 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 07:34:06 +00:00
rpotts%netscape.com
907eec02fc Removed 2 *extra* calls to NS_RELEASE in failure cases...
git-svn-id: svn://10.0.0.236/trunk@50325 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 06:58:42 +00:00
dveditz%netscape.com
cb001a0982 build fix, packager needs to know about changed Win32 names
git-svn-id: svn://10.0.0.236/trunk@50324 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 04:59:59 +00:00
warren%netscape.com
6320eadc46 Fixed refcounting problem and possible out-of-memory condition. r=kipp
git-svn-id: svn://10.0.0.236/trunk@50323 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 02:08:08 +00:00
dveditz%netscape.com
30a83caa1d Fixing 8.3 library name problems, bugs 10355, 10359,10364, 10365, 10372, 11796, 11791. Checking in for cathleen, r=dveditz
git-svn-id: svn://10.0.0.236/trunk@50322 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-10 01:32:59 +00:00
ssu%netscape.com
765cdf4fa9 fixing bug #15953. No fix is not part of tinderbox builds. affects only windows. Got approval from Syd_Sheriff. Also updated config.ini to not reference the editor since it has been rolled into the core.xpi.
git-svn-id: svn://10.0.0.236/trunk@50321 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 22:21:11 +00:00
ssu%netscape.com
f818f184a0 this checkin is to help fix bug #15393. There is one more step to truly fix it, which will come later. Reviewed by sgehani@netscape.com. This only affects windows platforms. This fix is needed because xpistub.dll no longers requires two callback functions: XpiStart() and XpiFinal().
git-svn-id: svn://10.0.0.236/trunk@50320 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 21:41:02 +00:00
ssu%netscape.com
2478da99aa this checkin is to help fix bug #15393. There is one more step to truly fix it, which will come later. This fix is by dveditz, and reviewed by ssu.
git-svn-id: svn://10.0.0.236/trunk@50319 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 21:37:21 +00:00
rginda%ndcico.com
27e760dac4 * Makefile.in, makefile.win
Install new css files and alternate images.

* README
Removed some rot.

* events.js
Add ability to disable a hook without uninstalling it.
Changed return value of addHook to the new hook object.
Added getHook(name) method.
Removed unused variable from routeEvent.

* http.js, irc-debug.js
Fixed spelling error.

* irc.js
network.onConnect no longer forwards the event to the server.
Added getModeStr() method to the IRCChanMode object to retrieve the entire mode string for a channel.

* utils.js
Added Clone() constructor.
Fixed problem in stringTrim.
Added getStackTrace() ... Whoopee!! ...

* bsconnection.c, bsutil.c
Stop warnings on Mac.

* index.html
Change links to buttons to avoid troubles with other methods (href="javascript:f()" | (href="javascript:(void 0)" | href="#") onclick="f()")

* test3-commands.js
Wiring for /testdisplay and /msg commands.

* test3-handlers.js
Added debug message toggle menuitem handler.
Added style change menu item handler.
Added hack to work around bad KeyUp events.
Factored out some logic from onInputCompleteLine into getObjectDetails (in test3-static.js)
Added /testdisplay and /msg implementation.
Fixed error message for unknown network passed to /network.
Added topicDate to output of /topic command.
updateNetwork and updateChannel calls sprinkled throughout to keep the statusbar current.
Added topic change handler.

* test3-static.js
Post new messages top to bottom!!
Disable the debug hook by default.
Added getObjectDetails (factored out of test3-handlers.js)
Added setOutputStyle to dynamically change the .cs file used for the output window.
Implemented updateNetwork and updateChannel.
Massive changes to .display methods make output window now display using a table, instead of spans (much faster, btw.)
Fixed addHistory to trim the correct side of the output, regardless of print direction.

* test3.css
Factored out output window styles.

* test3.xul
Added menu options for debug message toggle and style changes.
Added statusbar (table.)

* test3-output-default.css, test3-output-marble.css
Added output window stylesheets.


git-svn-id: svn://10.0.0.236/trunk@50318 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 21:26:52 +00:00
ssu%netscape.com
84d2d35991 fixing bug #15584. reviewed by sgehani@netscape.com. Fixes build warnings under linux.
git-svn-id: svn://10.0.0.236/trunk@50317 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 21:08:35 +00:00
law%netscape.com
7f7558dc5d Bug #15916; cleaned up context menu generation to make it faster; rev=hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50316 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 07:58:24 +00:00
law%netscape.com
2705d8b72b Bug #14999; removed use of toolkit app core; rev=scottip@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50315 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:23:30 +00:00
law%netscape.com
0a8ef0fe92 Bug #14999; removed use of toolkit app core; rev=rgoodger@ihug.co.nz
git-svn-id: svn://10.0.0.236/trunk@50314 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:21:53 +00:00
law%netscape.com
8191c9d684 Bug #14999; removed use of toolkit app core; rev=davidm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50313 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:18:58 +00:00
law%netscape.com
79880beab5 Bug #14999; removed use of toolkit app core; rev=tao@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50312 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:17:46 +00:00
law%netscape.com
7db449cd06 Bug #14999; removed use of toolkit app core; rev=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50311 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:16:33 +00:00
law%netscape.com
18dd71d7d3 Bug #14999; removed use of toolkit app core; rev=dbragg@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50310 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:15:06 +00:00
jband%netscape.com
8d3833cb33 Much of this is under the auspices of bug 15794. r=mccabe.
- map xpcshell's 'quit()' to a loop exit rather than calling
'exit(0)' so that the cleanup and leak detection code will still
get called.

- add NS_InitXPCOM and NS_ShutdownXPCOM to xpcshell to run said
cleanup and leak detection code.

- use more NS_IF_* macros

- fix numerous places where code assumed that
nsXPConnect::GetXPConnect() does not add a new ref on the
xpconnect singleton object (the behavior changed some time back
but not all the uses did - brainfade!).

- fix nsXPCException::NewException to automatically trim
'dataless' native stackframes off of the front of a stack trace.
The old system of manually telling it how many frames to trim was
not working well. We really want the first frame showing to be an
'interesting' frame so that callers who get exceptions thrown at
them will see some useful information rather than an empty native
frame that represents (but says nothing about) some native frame
in the xpconnect runtime.

- remove an extra addref from the trimming loop in
nsXPCException::NewException.

- Stop building XPCJSStack objects. XPConnect stacks are singly
linked lists of XPCJSStackFrame objects with refcounted links. I
had this stupid idea that each object would have a refcounted
link to a XPCJSStack object that would tie together the lifetimes
of all objects in the chain. This was overcomplex and
unnecessary. The linked list was enough. Any frame without a
refcount deserved to be deleted because it is simply unreachable.
There was no reason to tie together all the lifetimes of each
object in the chain. So this has been simplified in a big way.

- fixed place in xpcthrower.cpp where we were leaking a refcount
on the xpconnect singleton each time an xpcexception was thrown.

- do cleanup and gc() at the end of xpctest_echo.js to use for
leak testing - all wrappers should go away.


git-svn-id: svn://10.0.0.236/trunk@50309 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 06:01:57 +00:00
morse%netscape.com
580e6e380c use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=neeti
git-svn-id: svn://10.0.0.236/trunk@50308 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 04:50:32 +00:00
sdagley%netscape.com
f5924be40d XP_MAC GC leak detector changes: using LMGetCurStackBase to compute stack bottom, and considering all threads GCable. r=sdagley (checking in for beard). bug=15906
git-svn-id: svn://10.0.0.236/trunk@50306 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:39:54 +00:00
sdagley%netscape.com
886d9b7c4f XP_MAC: turning off a spurious assert in PR_Lock (which can get called at interrupt time!). r=sdagley (checking in for beard). bug=15906
git-svn-id: svn://10.0.0.236/trunk@50305 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:39:52 +00:00
beard%netscape.com
d2773dffe3 fix build bustage, accidentally left GC_LEAK_DETECTOR on.
git-svn-id: svn://10.0.0.236/trunk@50304 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:31:58 +00:00
beard%netscape.com
79da82091a fix memory leaks (nsMacMessage sink). r=pavlov, bug=15380
git-svn-id: svn://10.0.0.236/trunk@50302 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:08:56 +00:00
beard%netscape.com
8927726ce7 added "Dump Leaks" menu item. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50301 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:01:44 +00:00
beard%netscape.com
4aa916c066 added dump leaks command. added explicit calls to NS_InitXPCOM/NS_ShutdownXPCOM. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50300 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 03:01:43 +00:00
beard%netscape.com
a193449dbf Changed MemAllocatorGC.o target to build MemAllocatorDebug.o. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50299 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:58:20 +00:00
beard%netscape.com
6d47545512 removed FSp_fopen.c, SymFiles.cpp now using native Mac file I/O. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50298 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:57:51 +00:00
beard%netscape.com
d568e564ce added :dist:gc: and :dist:mac: to access paths. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50297 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:56:56 +00:00
beard%netscape.com
9a6d1be468 GC_add_roots -> GC_register_fragment, GC_remove_roots -> GC_unregister_fragment. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50296 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:56:55 +00:00
beard%netscape.com
c3710aa7cf added "IDE_Options.h" to ensure consistent build settings. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50295 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:54:38 +00:00
beard%netscape.com
ab9846ab1e added gc_fragments.h. r=jar, bug=15906
git-svn-id: svn://10.0.0.236/trunk@50294 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:53:25 +00:00
beard%netscape.com
bfb9762e5a nsFileSpec.GetLeafName() allocates a string, fix leak. r=warren, bug=15380
git-svn-id: svn://10.0.0.236/trunk@50293 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:52:46 +00:00
cls%seawood.org
f49139b533 Bug #13782 r=ramiro
Fixed the various clean targets so that a distclean is only performed on GtkMozilla when explicitly asked for.


git-svn-id: svn://10.0.0.236/trunk@50292 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:41:01 +00:00
dveditz%netscape.com
19c0e43ded fixing Win32 debug build bustage with NS_LOG_ADDREF. r=mccabe
git-svn-id: svn://10.0.0.236/trunk@50291 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:09:31 +00:00
mccabe%netscape.com
d69dd3df67 Fix to 15813. Change to using nsFileSpec to read .xpt files; this is 2x faster on the Mac. Fix courtesy Simon Fraser.
r=sfraser, or r=mccabe, depending on how you look at it.


git-svn-id: svn://10.0.0.236/trunk@50290 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 02:07:35 +00:00
edburns%acm.org
dc683794a3 Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=15902
Approved by: edburns@acm.org
Reviewed by: edburns@acm.org
Authored by: idk@eng.sun.com


git-svn-id: svn://10.0.0.236/trunk@50289 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 01:34:29 +00:00
selmer%netscape.com
dc6d4aa6fa New standard makefile
git-svn-id: svn://10.0.0.236/trunk@50288 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 01:33:45 +00:00
rhp%netscape.com
99e13cf601 Changes to fix VCard display problems - Changed generated JS - Bugs: #14204 and #12352 - Reviewer: scottip
git-svn-id: svn://10.0.0.236/trunk@50287 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 01:19:00 +00:00
edburns%acm.org
66eaef7892 Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=15607
Approved by: av@netscape.com
Reviewed by: av@netscape.com

/**

 * This method queries the prefs for proxy information.

 * It has been tested and is known to work in the following three cases

 * when no proxy host or port is specified

 * when only the proxy host is specified

 * when only the proxy port is specified

 * This method conforms to the return code specified in

 * http://developer.netscape.com/docs/manuals/proxy/adminnt/autoconf.htm#1020923

 * with the exception that multiple values are not implemented.

 */

NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)


git-svn-id: svn://10.0.0.236/trunk@50286 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 01:18:02 +00:00
slamm%netscape.com
5ff13771d4 Use temporary file name without process number for checkout. I was getting the name wrong because I refered to it in a new process (still using the 17606 variable. Hopefully this will be the final checking for bug #15750. r=waterson. I updated some comments too.
git-svn-id: svn://10.0.0.236/trunk@50285 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-09 00:31:17 +00:00
dp%netscape.com
c6019b3551 adding precheckin tests. r=matt
git-svn-id: svn://10.0.0.236/trunk@50284 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:50:49 +00:00
dp%netscape.com
3be8f0bb27 Adding precheckin tests
git-svn-id: svn://10.0.0.236/trunk@50283 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:48:20 +00:00
av%netscape.com
f82a173c1b Bug 15178, r=vidur adding check for return value avoiding crash
git-svn-id: svn://10.0.0.236/trunk@50282 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:47:03 +00:00
av%netscape.com
c4fd2231d1 Bug 15178, r=vidur adding check for null-pointer avoiding crash
git-svn-id: svn://10.0.0.236/trunk@50281 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:46:23 +00:00
terry%mozilla.org
22765f12e4 Fixed bug 15890 -- was producing garbled SQL if doing a query
that required the bugs_activity table.


git-svn-id: svn://10.0.0.236/trunk@50280 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:45:42 +00:00
kipp%netscape.com
fb8e1bdb06 Fixed cellmap ctor/dtor logging to not show up negative
git-svn-id: svn://10.0.0.236/trunk@50279 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:42:13 +00:00
kipp%netscape.com
9c16516bfc Fixed a comment that was out of date
git-svn-id: svn://10.0.0.236/trunk@50278 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:41:39 +00:00
kipp%netscape.com
a4f420d4fb Fixed up hook to track library loads for refcnt logging
git-svn-id: svn://10.0.0.236/trunk@50277 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:41:18 +00:00
kipp%netscape.com
6a697df2cd Always call dump-statistics and reset-statistics so that MOZ_DUMP_LEAKS isn't required
git-svn-id: svn://10.0.0.236/trunk@50276 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:40:52 +00:00
kipp%netscape.com
fabbe52905 Tweaked to avoid a crash in case bloat tracking is on but there is no bloat data to dump
git-svn-id: svn://10.0.0.236/trunk@50275 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:39:57 +00:00
beard%netscape.com
b625f8c219 modernized constants.
git-svn-id: svn://10.0.0.236/trunk@50274 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:35:34 +00:00
beard%netscape.com
3270b2a66f Rewrote using Mac file I/O, since MSL can only manage 35 FILEs.
git-svn-id: svn://10.0.0.236/trunk@50273 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:35:32 +00:00
jfrancis%netscape.com
84003fe77b applying same fix as rev 1.28 (initializing mIsDone) to the rest of the Init() methods.
git-svn-id: svn://10.0.0.236/trunk@50272 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:34:07 +00:00
nisheeth%netscape.com
2a38ee05b4 Not currently part of the build. Added a stack behind the save/restore timing macros.
git-svn-id: svn://10.0.0.236/trunk@50271 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:27:09 +00:00
akhil.arora%sun.com
9dcd28272e Fixes Bug 15837 by instantiating the proper subtype of Node instead of Node.
Fixed by Igor Nekrestyanov <nis@sparc.spb.su>.
Reviewed by Akhil Arora <akhil.arora@sun.com>.


git-svn-id: svn://10.0.0.236/trunk@50270 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:22:52 +00:00
troy%netscape.com
bae6f56e4b Changes to SizeOf() code only. This code is debug code that only runs
when you chose the "Show Frame Sizes" menu item...


git-svn-id: svn://10.0.0.236/trunk@50269 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:18:19 +00:00
kipp%netscape.com
deff3927b7 new
git-svn-id: svn://10.0.0.236/trunk@50268 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 23:04:26 +00:00
selmer%netscape.com
6f9a832691 Configs instead of Customizations directory
git-svn-id: svn://10.0.0.236/trunk@50267 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:56:29 +00:00
rogerl%netscape.com
5e3057bc5f Fixed 14060 - calling exec on java methods was gettmg caught by exec
trapping nonsense.


git-svn-id: svn://10.0.0.236/trunk@50266 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:55:33 +00:00
syd%netscape.com
062e198b32 Export platform.h. This is legacy stuff that should be removed eventually.
r=mcafee.


git-svn-id: svn://10.0.0.236/trunk@50264 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:37:37 +00:00
syd%netscape.com
52eb9ba5eb Build into include for exports (currently just platform.h) r=mcafee
git-svn-id: svn://10.0.0.236/trunk@50263 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:36:46 +00:00
kipp%netscape.com
ba85b17922 Unbreak people who were actually using MOZ_TRACE_XPCOM_REFCNT
git-svn-id: svn://10.0.0.236/trunk@50262 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:30:19 +00:00
troy%netscape.com
69fbd973a0 Fix for blocker #15839. r=kipp@netscape.com,kin@netscape.com
Typing into a text area wasn't working properly. Problem was that when the text
changed we were reflowing the text frames with a resize reflow command and
we thought we could optimize the reflow. So I changed ContentChanged() to
mark each text frame dirty so we would know not to do the optimization


git-svn-id: svn://10.0.0.236/trunk@50261 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:04:31 +00:00
kipp%netscape.com
041db07f43 Fixed opt build bustage
git-svn-id: svn://10.0.0.236/trunk@50260 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 22:04:04 +00:00
kipp%netscape.com
60a9b36aae Fixed windows build bustage
git-svn-id: svn://10.0.0.236/trunk@50256 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 21:19:42 +00:00
cls%seawood.org
075aedf4ee Ok, let's not try to generate the remove list if there is no library to remove things from
git-svn-id: svn://10.0.0.236/trunk@50255 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 21:17:32 +00:00
waterson%netscape.com
ca11a90c92 Initial revision. Not in build.
git-svn-id: svn://10.0.0.236/trunk@50251 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 21:15:21 +00:00
waterson%netscape.com
84e4143c7e Add new files not in the build.
git-svn-id: svn://10.0.0.236/trunk@50248 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 21:11:20 +00:00
morse%netscape.com
abd3497f8c use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=neeti
git-svn-id: svn://10.0.0.236/trunk@50246 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:47:17 +00:00
cbegle%netscape.com
6389e9eed1 Adding new files. Tests for XPConnect. These files are not part of the
build.  R=jband@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50245 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:45:37 +00:00
kipp%netscape.com
16a80cecba Tweaked stack trace display code
git-svn-id: svn://10.0.0.236/trunk@50244 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:42:33 +00:00
kipp%netscape.com
bbf17a2772 Support demangling again by working around crash bug in demangle library
git-svn-id: svn://10.0.0.236/trunk@50243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:42:15 +00:00
kipp%netscape.com
5b712622da Enable NS_FreeImageManager now that the call is part of the tip
git-svn-id: svn://10.0.0.236/trunk@50242 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:41:49 +00:00
kipp%netscape.com
0eec4f1a12 nuked
git-svn-id: svn://10.0.0.236/trunk@50241 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:41:21 +00:00
kipp%netscape.com
e18af2d0ee Cleanup moz-decl-counter usage and fix NS_LOG_ADDREF usage
git-svn-id: svn://10.0.0.236/trunk@50239 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:41:19 +00:00
neeti%netscape.com
0f9df28d81 Converted nsxpi.dll and xpiflash.dll to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=dougt
git-svn-id: svn://10.0.0.236/trunk@50238 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:41:13 +00:00
ftang%netscape.com
655211e9e0 remove obsolted file
git-svn-id: svn://10.0.0.236/trunk@50237 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:35:24 +00:00
ftang%netscape.com
e62cab32bc change to nsIModule r=kipp
git-svn-id: svn://10.0.0.236/trunk@50236 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:30:58 +00:00
ftang%netscape.com
ff64ed5645 remove factory file and add module file
git-svn-id: svn://10.0.0.236/trunk@50235 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:30:42 +00:00
cls%seawood.org
7ac835a8b2 Added a test to see if there are any archive members to be removed before calling AR_DELETE as NetBSD's & OpenBSD's versions of ar do not like removing an empty list.
r=leaf


git-svn-id: svn://10.0.0.236/trunk@50234 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:30:28 +00:00
kipp%netscape.com
b44472476c Merged bloaty and moz ctor counting (space team work)
git-svn-id: svn://10.0.0.236/trunk@50233 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:29:47 +00:00
ftang%netscape.com
7ce12116c7 add new file for nsIMoudle work, r=kipp
git-svn-id: svn://10.0.0.236/trunk@50232 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 20:27:24 +00:00
slamm%netscape.com
16bf5b4e43 Backout troy's last set of changes. Caused bug #15790, 'opening bookmarks window and expanding mail folders crashes'. r=waterson.
git-svn-id: svn://10.0.0.236/trunk@50230 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 18:52:19 +00:00
beard%netscape.com
f5cc851bd0 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50229 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 17:51:45 +00:00
slamm%netscape.com
2b7533ef10 Fix empty sidebar. bug #15468. Need to wait for sidebar-panels in init routine.
git-svn-id: svn://10.0.0.236/trunk@50227 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 17:15:27 +00:00
rickg%netscape.com
24c8eb13e7 added default XML apos entity; no bug #. This update (and my last) were reviewed by peterl
git-svn-id: svn://10.0.0.236/trunk@50226 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 15:05:41 +00:00
rickg%netscape.com
7bfc990fcf fixed bug 15649; when the parsing library was modularized last week, tag lookup for view source got disconnected. This simply reconnects it.
git-svn-id: svn://10.0.0.236/trunk@50225 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:52:16 +00:00
terry%mozilla.org
b978d371e9 Added ability to query by votes.
git-svn-id: svn://10.0.0.236/trunk@50224 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:47:21 +00:00
terry%mozilla.org
8c7166d122 Added ability to query by votes.
git-svn-id: svn://10.0.0.236/trunk@50223 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:41:17 +00:00
buster%netscape.com
273f420e23 fixed my part of bug 15814 (Cleanup build warnings)
so trivial, no reviewer needed
fixed my part of bug  5403 (Services improperly released: Use NS_WITH_SERVICE)
a handful of subtle error handling bugs were fixed as a side effect
r=Akkana


git-svn-id: svn://10.0.0.236/trunk@50222 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:39:20 +00:00
law%netscape.com
edef6fb916 For bug #14999; adding new method to simplify applying OpenDialog to the hidden window. rev=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50219 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:04:17 +00:00
terry%mozilla.org
2aa7b332a8 Fixed bug 15808 -- previous change had busted querying of CC.
git-svn-id: svn://10.0.0.236/trunk@50218 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 14:01:02 +00:00
rods%netscape.com
db039d9432 ifdef'ed out a static counter for debugging. r=kmcclusk b=15637
git-svn-id: svn://10.0.0.236/trunk@50217 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 12:24:11 +00:00
sgehani%netscape.com
97b88d421f Failover implemented for i18n strings in XPInstall if the string bundle service is not available, fails, or if the .properties resource file is not avilable. Fixes install wizard logging. Completion of fix for bug 8140. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@50216 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 09:00:13 +00:00
sspitzer%netscape.com
4b800ef247 more clean up. #15402.
git-svn-id: svn://10.0.0.236/trunk@50215 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 07:58:54 +00:00
waterson%netscape.com
199c8166c7 Misc cleanup, r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50214 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 07:26:39 +00:00
waterson%netscape.com
fbecb0f668 Add elements to element map by 'ref', as well.
git-svn-id: svn://10.0.0.236/trunk@50213 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 07:26:14 +00:00
sspitzer%netscape.com
1dd1cfee5a temporary printfs to help me debug the elusive #15792 that only bijals is seeing
git-svn-id: svn://10.0.0.236/trunk@50212 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 07:12:21 +00:00
sspitzer%netscape.com
52d84b804d just checking in comments. resizeToContent() makes the "Create Profile Wizard"
take up the whole screen.  (bug logged on danm already.)


git-svn-id: svn://10.0.0.236/trunk@50211 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 06:50:26 +00:00
cls%seawood.org
a0ade5ef67 Checking in locally generated configure until briano's script gets fixed
git-svn-id: svn://10.0.0.236/trunk@50210 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 05:57:01 +00:00
sspitzer%netscape.com
4b226a4436 when renaming a profile, and renaming the profile directory on disk,
don't do a copy and delete.  just rename the directory.
r=davidm, #15402


git-svn-id: svn://10.0.0.236/trunk@50209 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 05:41:40 +00:00
cls%seawood.org
07d74ceef4 Applied Jim Nance's, <jim_nance@yahoo.com>, patch to reduce the size of a build by using a modified version of GNU make's implicit ruleset that incrementally add object files to static library archive and eliminates the need to have the unused object files sitting around. A clobber is required to see the savings.
Bug #15241 . r=sleestack


git-svn-id: svn://10.0.0.236/trunk@50208 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 05:18:46 +00:00
sspitzer%netscape.com
d4f79e4e21 fix build bustage on windows.
git-svn-id: svn://10.0.0.236/trunk@50207 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 05:14:48 +00:00
troy%netscape.com
093e5bfd97 Change to SizeOf() code (diagnostic code only). Changed table frame
code to split the column cache size out into a separate listing


git-svn-id: svn://10.0.0.236/trunk@50206 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 05:12:55 +00:00
sspitzer%netscape.com
3ba1fc9867 more clean up of the profile code. #15402, r=davidm
make profileExists() part of the nsIProfile interface, so I can
get at it from JS.  startCommunicator is now startApprunner.
get RenameProfile() and DeleteProfile() to work better.
make the delete profile dialog size to content.
change the 2nd arg of DeleteProfile() to be a bool, and not a string.
use MakeUnique() to prevent undesired collisions of profiles on disk.


git-svn-id: svn://10.0.0.236/trunk@50205 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:58:32 +00:00
sspitzer%netscape.com
127e23606e add some bulletproofing. r=davidm
git-svn-id: svn://10.0.0.236/trunk@50204 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:55:37 +00:00
sspitzer%netscape.com
be500f5f77 make the prompt and alert dialogs resize to content.
fix by davidm, r=sspitzer, bug #15815


git-svn-id: svn://10.0.0.236/trunk@50203 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:51:19 +00:00
troy%netscape.com
28f1fa0323 Removed some dead code and moved some #if 0 code from the area frame
to the block frame. This completes the previous checkin


git-svn-id: svn://10.0.0.236/trunk@50202 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:45:12 +00:00
warren%netscape.com
15a67038a4 Fixed bug in computing object count mean and stddev.
git-svn-id: svn://10.0.0.236/trunk@50201 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:39:24 +00:00
troy%netscape.com
579c8e2248 Frame space reductions. r=kipp@netscape.com
Table cell frames and table caption frames now use block frames and not area
frames. This saves 24 bytes per frame instance


git-svn-id: svn://10.0.0.236/trunk@50200 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:32:46 +00:00
beard%netscape.com
312671bf23 added .xSYM address to source mapping.
git-svn-id: svn://10.0.0.236/trunk@50199 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:14:09 +00:00
beard%netscape.com
cc845797fa changed format of object size.
git-svn-id: svn://10.0.0.236/trunk@50198 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:13:44 +00:00
beard%netscape.com
8c486b4dbf added address to source mapping using .xSYM files.
git-svn-id: svn://10.0.0.236/trunk@50197 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:13:04 +00:00
beard%netscape.com
3da62e7fd4 added Histogram report.
git-svn-id: svn://10.0.0.236/trunk@50196 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:12:11 +00:00
beard%netscape.com
d75c5a8f47 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50195 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 04:11:39 +00:00
danm%netscape.com
fefde390b5 hiddenWindow loads its full glory only on the Mac. speeds launch time for everyone else. r:hyatt
git-svn-id: svn://10.0.0.236/trunk@50194 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 03:31:41 +00:00
peterl%netscape.com
d1916dab07 First step at fixing 12106, factored out style rule processing from
style sheets into a seperate style rule processor interface
r=troy


git-svn-id: svn://10.0.0.236/trunk@50193 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 03:09:31 +00:00
leaf%mozilla.org
12ad3a8ea1 << termination needs to be the first thing on the line, no preceding whitespace
fixing solaris build


git-svn-id: svn://10.0.0.236/trunk@50192 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 02:27:34 +00:00
peterl%netscape.com
41ae9835a0 removed setting of border color for table parts (cruft from the dark ages)
Bug 15802
r=rickg


git-svn-id: svn://10.0.0.236/trunk@50191 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 02:07:37 +00:00
mscott%netscape.com
42395fb4cd Bug #14612. I'm checking this in for warren. r=mscott
The pipe shouldn't block when you write more bytes into the pipe than the size of the pipe's buffer. Add an extra
notify to the writer of the pipe after we read data out of it.


git-svn-id: svn://10.0.0.236/trunk@50190 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 02:03:34 +00:00
ducarroz%netscape.com
02844df3be Fix for bug 15720, We need to tell the nsMsgLineBuffer which format of line break we will use. R=jefft,mscott
git-svn-id: svn://10.0.0.236/trunk@50189 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:55:36 +00:00
warren%netscape.com
c9fbdb8075 Fixed AddRef/Release problems to eliminate negative refcounts in Bloaty.
git-svn-id: svn://10.0.0.236/trunk@50188 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:49:06 +00:00
tao%netscape.com
9470ef781b Hook up l10n/ when MOZ_L10N is defined.
git-svn-id: svn://10.0.0.236/trunk@50187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:32:44 +00:00
alecf%netscape.com
450082561c fix mac-specific bustage
git-svn-id: svn://10.0.0.236/trunk@50186 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:11:13 +00:00
tao%netscape.com
de2f3b6942 Move da-DK files to l10n/lang; r=leaf
git-svn-id: svn://10.0.0.236/trunk@50185 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:06:56 +00:00
alecf%netscape.com
c3ba33bbb8 fix windows bustage
git-svn-id: svn://10.0.0.236/trunk@50184 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 01:01:56 +00:00
edburns%acm.org
d6eb736cf5 1999-10-07 <Ed Burns <ed.burns@sun.com>>
* This change fixes
 	http://bugzilla.mozilla.org/show_bug.cgi?id=15793 which caused one
 	to have to copy the component.reg and components directory.  It
 	also causes webclient to do autoregistration.  It also adds a
 	debugging method to BrowserControlMozillaShim.java
 	nativeDebugBreak().

	This changes makes webclient depend on having mozilla sources from
 	10/5/99 or later.

	Reviewed by Mark Lin <marklin@eng.sun.com>
	Approved by Ed Burns <edburns@acm.org>, module owner


git-svn-id: svn://10.0.0.236/trunk@50183 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:52:53 +00:00
edburns%acm.org
f0ebe3333d 1999-10-07 <Ed Burns <ed.burns@sun.com>>
* This change fixes
 	http://bugzilla.mozilla.org/show_bug.cgi?id=15793 which caused one
 	to have to copy the component.reg and components directory.  It
 	also causes webclient to do autoregistration.  It also adds a
 	debugging method to BrowserControlMozillaShim.java
 	nativeDebugBreak().

	This changes makes webclient depend on having mozilla sources from
 	10/5/99 or later.

	Reviewed by Mark Lin <marklin@eng.sun.com>
	Approved by Ed Burns <edburns@acm.org>, module owner


git-svn-id: svn://10.0.0.236/trunk@50182 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:48:01 +00:00
alecf%netscape.com
0a89ba79ef oops, remove XP_UNIX specific stuff which was busting things
git-svn-id: svn://10.0.0.236/trunk@50181 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:37:17 +00:00
terry%mozilla.org
479c02d23b Sorting by the vote column was busted.
git-svn-id: svn://10.0.0.236/trunk@50180 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:30:49 +00:00
sspitzer%netscape.com
af65076fcc don't specify the width and height, so the dialog resizes to content.
git-svn-id: svn://10.0.0.236/trunk@50178 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:17:22 +00:00
alecf%netscape.com
867ac81c42 add new NS_xxx_MODULE* macros (not used anywhere in the build just yet)
git-svn-id: svn://10.0.0.236/trunk@50177 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:12:29 +00:00
jband%netscape.com
1c2af52291 fix warning of old style C++ variable scope declared in 'for'. bug 15778. r=slamm
git-svn-id: svn://10.0.0.236/trunk@50176 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-08 00:11:05 +00:00
tao%netscape.com
524f22fa3d Move localized resource files to mozilla/l10n/lang.
git-svn-id: svn://10.0.0.236/trunk@50173 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:59:32 +00:00
alecf%netscape.com
f562178cfd exorcise xp.h from compose header files, in preparation for nsIModule landing
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50172 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:55:42 +00:00
terry%mozilla.org
ff8d0b5547 Added the ability for users to "vote" on which bugs they think should
be fixed.


git-svn-id: svn://10.0.0.236/trunk@50171 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:54:52 +00:00
rickg%netscape.com
32ae9a79ff fixed bug 15881; r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50170 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:52:29 +00:00
rickg%netscape.com
dee37d8ec6 fixed bug 15788; r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50169 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:51:29 +00:00
mscott%netscape.com
14bcf4dfb6 Bug #11836 --> convert local factory to be a nsIModule
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@50168 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:35:10 +00:00
mscott%netscape.com
53ff6e3994 Bug #12198 --> don't dereference a null ptr for the uri. return gracefully.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50167 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:29:13 +00:00
mscott%netscape.com
dea623bfa3 Bug #15615 --> when the proxy code is processing an event, we can't be holding onto the event queue's monitor. Because
you could run into the scenario where in processing the event, the thread blocks waiting for an event from another thread.
That thread tries to post the event to the orginal thread's event Queue but can't enter the queue's monitor.
r=warren (or reviewed by me depending on your point of view since we figured it out together).


git-svn-id: svn://10.0.0.236/trunk@50166 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:25:36 +00:00
danm%netscape.com
c631c144f2 killing general table and td rules since these are global to the entire app, and table display:block in particular will break all tables. want to remove other rules, too, but stopped with the delightfully self-contradictory #righttext, which isn't used. r:hyatt
git-svn-id: svn://10.0.0.236/trunk@50165 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:10:41 +00:00
waterson%netscape.com
2064c545e9 Bug 15687. Make sure to test whether CreateTemplateBuilder() succeeded before dereferencing the builder we get back. r=rjc
git-svn-id: svn://10.0.0.236/trunk@50164 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:07:00 +00:00
terry%mozilla.org
7edab401af Helpfile for voting feature.
git-svn-id: svn://10.0.0.236/trunk@50163 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 23:03:59 +00:00
slamm%netscape.com
70d8dbcabe Make the sidebar panels appear. Bug #15468. r=mcafee. Had 'datasources' defined when it wasn't needed.
git-svn-id: svn://10.0.0.236/trunk@50159 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 22:56:22 +00:00
selmer%netscape.com
fdf016b522 varada - bug #15770 adding extra funtions to create button in checklist.ini to verify presence of config before doing a copy
git-svn-id: svn://10.0.0.236/trunk@50157 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 22:18:13 +00:00
sspitzer%netscape.com
eb6f6392d7 add new line to the end of the file.
git-svn-id: svn://10.0.0.236/trunk@50156 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 22:05:53 +00:00
slamm%netscape.com
7d127002f9 Fix solaris build bustage. The shell does not like {} command grouping. Use () instead.
git-svn-id: svn://10.0.0.236/trunk@50155 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 22:04:04 +00:00
rods%netscape.com
4d74acf338 minor adjustment for focus
git-svn-id: svn://10.0.0.236/trunk@50154 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:58:14 +00:00
rods%netscape.com
4c6b85103e Addtional changes for form padding and borders
r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50153 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:54:13 +00:00
warren%netscape.com
fc64e1c69b Added 'Bloaty' refcounting and memory bloat statistics code
git-svn-id: svn://10.0.0.236/trunk@50152 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:50:20 +00:00
mcafee%netscape.com
c322512ff3 Adding leaky to the linux/intel build. a=ramiro, r=slamm
git-svn-id: svn://10.0.0.236/trunk@50151 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:48:05 +00:00
rods%netscape.com
3b7075a69b Changed the border and padding for all the form control frames to be as compatible with Nav Quirks as we can
added rules for form controls inside of tables
r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50150 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:47:54 +00:00
rods%netscape.com
3848b18fe7 Added the COMPAre macro for comparing sizes with NavQuirks
r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50149 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:46:31 +00:00
neeti%netscape.com
b0bb720dd1 updating status.
git-svn-id: svn://10.0.0.236/trunk@50148 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:44:37 +00:00
valeski%netscape.com
5735cf240f not in build. test app for makeabsolute performance
git-svn-id: svn://10.0.0.236/trunk@50147 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:43:49 +00:00
rods%netscape.com
32093a83c6 Changed the way the list figures out how high a single item is, it now subtracts out the padding & border instead of just the border
r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50146 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:39:50 +00:00
rods%netscape.com
f291b097d5 Removed code where standard mode was incorrectly subtracting border size
r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50145 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:37:02 +00:00
slamm%netscape.com
1c08cd13d9 Quit when cvs has an error. Previously it kept going. Bug #15750. r=mcafee. Also change default module from SeaMonkeyEditor to SeaMonkeyAll.
git-svn-id: svn://10.0.0.236/trunk@50144 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:24:17 +00:00
rods%netscape.com
d66d5defc6 Added macro to help in figuring Nav Quirks default size for all
controls ifdef for just me. Renamed aMetrics to aDesiredSize
Did some clean. Nav Quirks obeys padding and not border.
Reworked how computed size is used r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50143 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:09:47 +00:00
rods%netscape.com
e6f28ca7ba Added macro to help in figuring Nav Quirks default size for all
controls ifdef for just me r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@50142 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:07:38 +00:00
rods%netscape.com
e414c28907 Added macro to help in figuring Nav Quirks default size for all controls r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50141 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:04:52 +00:00
dp%netscape.com
c94e8e9c8e Removing ifdef DEBUG_dp.
git-svn-id: svn://10.0.0.236/trunk@50140 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:03:48 +00:00
endico%mozilla.org
a566a33989 fixed html error so the grey text search box will be aligned at top
git-svn-id: svn://10.0.0.236/trunk@50139 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:02:59 +00:00
pinkerton%netscape.com
1452789bbd correctly determine when the image has changed sizes to avoid causing unnecessary reflows. now comparing twips to twips instead of twips to pixels. part of fix for bug #15722 (r=evaughan).
git-svn-id: svn://10.0.0.236/trunk@50138 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:02:58 +00:00
dp%netscape.com
cc675f4462 Instrumentation to detect leaks of BrowserInstance. r=don
git-svn-id: svn://10.0.0.236/trunk@50136 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 21:01:16 +00:00
sfraser%netscape.com
b591bc9b02 Fix for bug 15749; passing null strings to nsFileSpec routines was doing bad things, like strlen(NULL). r=dougt
git-svn-id: svn://10.0.0.236/trunk@50135 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:57:21 +00:00
norris%netscape.com
15352050f2 Enable URI checks for web JavaScript.
Fixes bug 11462 "Need checks for setting URLs"
Reviewed by mstoltz.


git-svn-id: svn://10.0.0.236/trunk@50134 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:56:49 +00:00
dp%netscape.com
27bf7b0e38 Fixed webshell leak caused by session history entry circular
reference. r=radha


git-svn-id: svn://10.0.0.236/trunk@50133 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:55:14 +00:00
kmcclusk%netscape.com
15925c0587 bug=15184 Made <input type=password> a form submitter. Hitting return in a password field
will now submit the form. r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50132 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:54:42 +00:00
rods%netscape.com
6fb1b8e0d6 set the padding to 1 related to bug# 15314
git-svn-id: svn://10.0.0.236/trunk@50131 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:53:23 +00:00
rhp%netscape.com
f536f04be7 Changes for bug #13098 - Reviewer: jefft
git-svn-id: svn://10.0.0.236/trunk@50130 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:53:06 +00:00
pavlov%netscape.com
46858a98ee unif 0 synchronous drawing on linux and add some checks to make sure we are visible and don't dump paint events when we are going to ignore them r=akkana
git-svn-id: svn://10.0.0.236/trunk@50128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:49:11 +00:00
kipp%netscape.com
759b90d985 Whoops, backed out last check - wasn't supposed to land it
git-svn-id: svn://10.0.0.236/trunk@50127 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:46:50 +00:00
kipp%netscape.com
3b5f2c1e21 r=kin; Added in ctor/dtor counts
git-svn-id: svn://10.0.0.236/trunk@50126 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:45:56 +00:00
rogerl%netscape.com
e143bf497c Fixed build failures - these files are NOT part of the seamonkey build.
git-svn-id: svn://10.0.0.236/trunk@50125 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:45:27 +00:00
rogerl%netscape.com
750861810b Fixed error reporting to not smack the source line with a zero, but use
copyN instead - things were failing when very last line of input had an
error and didn't end with '\n'. r=mccabe


git-svn-id: svn://10.0.0.236/trunk@50124 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:44:40 +00:00
dcone%netscape.com
c0cc4a7df7 Took out a pure virtual function CreateRenderingContext() that was declared in the interface
git-svn-id: svn://10.0.0.236/trunk@50123 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:43:03 +00:00
rogerl%netscape.com
df73818e4c Fixed build warnings by removing macros with '{..}'.
Made str_escape available for jsfile.
r=mccabe


git-svn-id: svn://10.0.0.236/trunk@50122 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:42:20 +00:00
rogerl%netscape.com
7ba994995c Making str_escape available for jsfile use. r=mccabe.
git-svn-id: svn://10.0.0.236/trunk@50121 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:41:15 +00:00
rogerl%netscape.com
cfd4889e52 Bug #12168. Catch new Array(NaN). r=mccabe.
git-svn-id: svn://10.0.0.236/trunk@50120 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:40:17 +00:00
dcone%netscape.com
09be733a85 Fixed some warnings
git-svn-id: svn://10.0.0.236/trunk@50119 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:40:00 +00:00
troy%netscape.com
70a3da2b30 Space reductions, r=karnaze@netscape.com
Eliminated one data member, moved one to flag frame state, and changed mBorderEdges
to be heap allocated (only for collapsing border model)


git-svn-id: svn://10.0.0.236/trunk@50117 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:38:50 +00:00
alecf%netscape.com
3f1f724756 add myself to fix DLLs
git-svn-id: svn://10.0.0.236/trunk@50116 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 20:15:58 +00:00
waterson%netscape.com
76ea87ea04 Bug 15683. Hack to get the tree open. Don't SetParent(nsnull), <option> elements do funky stuff when the <option> is inside a <xul:template>. r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50114 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 19:32:39 +00:00
norris%netscape.com
9754a010ca Fix 15711 Can't call java.lang.Class methods from JS
git-svn-id: svn://10.0.0.236/trunk@50112 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 18:27:21 +00:00
norris%netscape.com
5ca75e8020 Subject:
Re: NPL vs. MPL
       Date:
            Wed, 06 Oct 1999 18:30:34 -0400
      From:
            "Ian D. Stewart" <idstewart@softhome.net>
        To:
            Norris Boyd <norris@netscape.com>
 References:
            1 , 2 , 3




Norris Boyd wrote:

  Great. So I'd like to change this copyright text

  /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset:
  4 -*-
   *
   * The contents of this file are subject to the Mozilla Public License
   * Version 1.0 (the "MozPL"); you may not use this file except in
   * compliance with the MozPL.  You may obtain a copy of the MozPL at
   * http://www.mozilla.org/NPL/
   *
   * Software distributed under the MozPL is distributed on an "AS IS"
  basis,
   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  MozPL
   * for the specific language governing rights and limitations under the
   * MozPL.
   *
   * The Initial Developer of this code under the MozPL is Ian D. Stewart.

   * Portions created by Ian D. Stewart are Copyright (C) 1998, 1999
   * Ian D. Stewart.
   * All Rights Reserved.
   */

  to this:

  /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset:
  4 -*-
   *
   * The contents of this file are subject to the Netscape 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/NPL/
   *
   * Software distributed under the License is distributed on an "AS
   * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express oqr
   * implied. See the License for the specific language governing
   * rights and limitations under the License.
   *
   * The Original Code is ListenerCollection, released
   * May 15, 1998.
   *
   * The Initial Developer of the Original Code is Ian D. Stewart.
   * Portions created by Ian D. Stewart are Copyright (C) 1998, 1999
   * Ian D. Stewart.
   * Rights Reserved.
   *
   * Contributor(s):
   * Ian D. Stewart
   *
   * Alternatively, the contents of this file may be used under the
   * terms of the GNU Public License (the "GPL"), in which case the
   * provisions of the GPL are applicable instead of those above.
   * If you wish to allow use of your version of this file only
   * under the terms of the GPL and not to allow others to use your
   * version of this file under the NPL, indicate your decision by
   * deleting the provisions above and replace them with the notice
   * and other provisions required by the GPL.  If you do not delete
   * the provisions above, a recipient may use your version of this
   * file under either the NPL or the GPL.
   */

  Can you give me your approval for this change?

Make it so.


Ian


git-svn-id: svn://10.0.0.236/trunk@50111 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 16:57:01 +00:00
dcone%netscape.com
75b915c855 Turned on the background tiling optimization.. Reviewed By rods
git-svn-id: svn://10.0.0.236/trunk@50110 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:57:32 +00:00
bienvenu%netscape.com
82ee650dbf try not to leak all environments r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50109 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:45:26 +00:00
bienvenu%netscape.com
879bafb0b6 try not to leak all factories r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50108 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:43:44 +00:00
bienvenu%netscape.com
fd723643f2 fix mork factory r=mscott 12326, also fix some memory leaks
git-svn-id: svn://10.0.0.236/trunk@50107 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:30:44 +00:00
bienvenu%netscape.com
5dbbb4bb89 fix mork factory r=mscott 12326, fix ref count logging
git-svn-id: svn://10.0.0.236/trunk@50106 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:29:45 +00:00
bienvenu%netscape.com
28bab47569 fix mork factory r=mscott 12326
git-svn-id: svn://10.0.0.236/trunk@50104 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:28:54 +00:00
bienvenu%netscape.com
391cdf28f4 fix mork factory r=waterson 12326
git-svn-id: svn://10.0.0.236/trunk@50103 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:27:50 +00:00
jefft%netscape.com
a2221d154c fixed bug 10801 -- [Featuure] Save Messages, bug 14794 - message sent from unsent folder display as raw message; we need to pay attention to where we want to save the message as template, if the message goes to the local mail folder we have to add the dummy envelope header plus the x mozilla status lines; when sending unsent messages we need to set from/sender information to pass the sanity check at the send time; reviewed by rhp
git-svn-id: svn://10.0.0.236/trunk@50102 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:27:11 +00:00
bienvenu%netscape.com
571b348058 use nsIModule for Mork r=mscott no bug
git-svn-id: svn://10.0.0.236/trunk@50101 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 14:26:15 +00:00
rods%netscape.com
af37c61c55 removed unused result to remove warning r=pinkerton
git-svn-id: svn://10.0.0.236/trunk@50100 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 13:47:43 +00:00
waterson%netscape.com
f958803974 Bug 13910. Make sure to update element map for XUL (as well as HTML) elements when changing 'id' or 'ref' attributes.
git-svn-id: svn://10.0.0.236/trunk@50099 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 10:09:17 +00:00
waterson%netscape.com
4bac26a215 Bug 13910. Make sure to add elements to the map by 'ref' attribute, as well.
git-svn-id: svn://10.0.0.236/trunk@50098 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 10:08:14 +00:00
sspitzer%netscape.com
834be86386 more clean up for #15402. disable the rename, delete and start buttons
if no profile is selected, and enable them when a profile is selected.
turn dumps into alerts to tell the user why something failed.


git-svn-id: svn://10.0.0.236/trunk@50097 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 09:41:33 +00:00
sspitzer%netscape.com
01e635a3a6 last touches to finally get Cancel (from the Create Profile Wizard) and Exit
(from the Profile Manager) to work properly.


git-svn-id: svn://10.0.0.236/trunk@50096 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 09:15:25 +00:00
sspitzer%netscape.com
4d9fe202fe fix my comment
git-svn-id: svn://10.0.0.236/trunk@50095 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 09:12:27 +00:00
sspitzer%netscape.com
faac109667 minor cleanup of the profile js. #15402
git-svn-id: svn://10.0.0.236/trunk@50094 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 09:03:07 +00:00
sspitzer%netscape.com
7ef56b5288 minor tweak on the way to getting Cancel / Exit to behave properly in the
Profile Manager UI.  they both set the current profile to "".


git-svn-id: svn://10.0.0.236/trunk@50093 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 09:01:23 +00:00
sspitzer%netscape.com
bde00ceef7 add documentation and fixes from Ben Goodger <rgoodger@ihug.co.nz>
also add the mozilla license.  r=sspitzer.


git-svn-id: svn://10.0.0.236/trunk@50092 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 08:47:16 +00:00
rickg%netscape.com
ac6276e5cd fixed leak using patch from beard; verified in purify. r=rgess; bug=15751
git-svn-id: svn://10.0.0.236/trunk@50090 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 07:22:57 +00:00
sspitzer%netscape.com
13d46b9f86 more fixes for #15402, general cleanup of the profile code. Close button is now Exit. remove GetSingleProfile(), use GetFirstProfile() instead. Add ForgetCurrentProfile() for use in getting cancel to work properly.
git-svn-id: svn://10.0.0.236/trunk@50089 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 06:57:38 +00:00
sspitzer%netscape.com
c0b38598d6 GetSingleProfile() is going away. use GetFirstProfile now.
git-svn-id: svn://10.0.0.236/trunk@50088 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 06:55:59 +00:00
sspitzer%netscape.com
c959c10bfc fix for #15735, r=waterson. fix the JS error by re-writing the C style
fancy logic.


git-svn-id: svn://10.0.0.236/trunk@50087 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 06:37:32 +00:00
warren%netscape.com
1e7a6bdb4d Fixed warnings.
git-svn-id: svn://10.0.0.236/trunk@50086 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 04:10:12 +00:00
neeti%netscape.com
7425479597 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=dveditz
git-svn-id: svn://10.0.0.236/trunk@50085 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 03:39:36 +00:00
rhp%netscape.com
9cdcbef4af Fixing a test program makefile. THIS IS NOT PART OF ANY BUILD!
git-svn-id: svn://10.0.0.236/trunk@50084 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 03:39:02 +00:00
rhp%netscape.com
9eb3c904c6 Fixing a test program. THIS IS NOT PART OF ANY BUILD!
git-svn-id: svn://10.0.0.236/trunk@50083 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 03:38:42 +00:00
sspitzer%netscape.com
94a677a8af fix for bug #15402. exit if we get past the profile manager without a current profile. this can happen.
git-svn-id: svn://10.0.0.236/trunk@50082 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 03:10:18 +00:00
beard%netscape.com
9d922a368f First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50081 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 03:03:36 +00:00
morse%netscape.com
1424e84e14 fix bug 15721, cookies not persistent, r=jar nsAppRunner.cpp
git-svn-id: svn://10.0.0.236/trunk@50080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 02:48:27 +00:00
ramiro%netscape.com
f2333c7dab Added mozilla/tools/leaky to SeaMonkeyCore. r=leaf.
git-svn-id: svn://10.0.0.236/trunk@50079 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 02:39:56 +00:00
beard%netscape.com
a57d0470d2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50078 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 02:11:44 +00:00
varada%netscape.com
dc0146ae24 have made error dialog box systemmodal bug #15339
git-svn-id: svn://10.0.0.236/trunk@50077 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 02:07:23 +00:00
rjc%netscape.com
1978802be8 Add in CTOR/DTOR stuff for leak detection. Review: hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50076 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:51:30 +00:00
kipp%netscape.com
51e85831e8 r=peterl; fixed a regression that I regrettably caused; had the test for success backwards
git-svn-id: svn://10.0.0.236/trunk@50075 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:44:16 +00:00
varada%netscape.com
0a87564964 %Root% is a global variable that contains the value of the current working directory - so we can use it in an inifile to resolve the relative root locations
git-svn-id: svn://10.0.0.236/trunk@50074 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:39:34 +00:00
harishd%netscape.com
946d742a4d In reference to bug # 12415
Added assertion ( per warrne's request ) to detect null char occasionally appearing in the input
stream provided by necko
R=pollmann


git-svn-id: svn://10.0.0.236/trunk@50073 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:30:56 +00:00
akkana%netscape.com
bc8b6d116e 13750,13753,14075,15293,13873,12551:
- Rewrite wrapping logic for plaintext output sink,
  and run all output through the wrapping/formatting Write method
  (which now has logic to determine when we should be wrapping).
- Handle blockquote type=cite mail quotes.
- Write several new regression tests for plaintext output bugs,
  and include those tests and their expected output into the
  automated output test.
r=sfraser,harishd


git-svn-id: svn://10.0.0.236/trunk@50072 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:10:32 +00:00
mcafee%netscape.com
0a81ee7839 Cleaning up whitespace so I can edit this file with a clue.
git-svn-id: svn://10.0.0.236/trunk@50071 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:07:41 +00:00
slamm%netscape.com
52995d7ec4 Remove call to sidebarOverlayInit(). This is already called in sidebarOverlay.js when sidebarOverlay.xul loads. Fixes bug #15719, 'Sidebar panels get added twice'. r=waterson.
git-svn-id: svn://10.0.0.236/trunk@50070 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 01:03:19 +00:00
sspitzer%netscape.com
deecdfd350 add an alert if there is no profile name. bug #15402
git-svn-id: svn://10.0.0.236/trunk@50069 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:55:51 +00:00
kipp%netscape.com
5fc1175eb9 Fixed a memory leak in the sizeof-handler logic (blush)
git-svn-id: svn://10.0.0.236/trunk@50068 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:49:40 +00:00
harishd%netscape.com
b84b2685ff Mapping nsDTDMode to eParseMode (in mozilla/htmlparser/src/nsIDTD.h)
R=pollmann


git-svn-id: svn://10.0.0.236/trunk@50067 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:35:16 +00:00
kipp%netscape.com
99aaa55232 Updated SizeOf methods for html content objects to be more accurate; implemented MOZ_DECL_CTOR_COUNTER for all html content objects
git-svn-id: svn://10.0.0.236/trunk@50066 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:35:04 +00:00
kipp%netscape.com
4e6e50c103 Tweaked call of log_release
git-svn-id: svn://10.0.0.236/trunk@50065 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:32:25 +00:00
kipp%netscape.com
b17c92e839 Added some atoms to support SizeOf metrics
git-svn-id: svn://10.0.0.236/trunk@50064 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:31:41 +00:00
kipp%netscape.com
d5ce80751a Work around a crash by stubbing out some pointers that are weak links that are not to be used during shutdown
git-svn-id: svn://10.0.0.236/trunk@50063 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:31:21 +00:00
kipp%netscape.com
b87e5bb00d Don't forget to remove the observer when dtor is running (fixes a sometimes crash in viewer); also fixed a memory leak of a style context
git-svn-id: svn://10.0.0.236/trunk@50062 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:30:20 +00:00
kipp%netscape.com
a72c992c6f Eliminate a memory leak of a style context (which ends up leaking all the stylecontexts upward)
git-svn-id: svn://10.0.0.236/trunk@50061 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:29:28 +00:00
harishd%netscape.com
080879ab10 Bug 13647
In nsXIFConverter::BeginContainer(const nsString& aTag)
newline was getting appended by default at the end of a tag.
Setting the default value to PR_FALSE to avoid newline insertion
at the end of a tag.
R=akkana


git-svn-id: svn://10.0.0.236/trunk@50060 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:28:58 +00:00
kipp%netscape.com
78b500998c Eliminate a warning
git-svn-id: svn://10.0.0.236/trunk@50059 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:28:41 +00:00
sspitzer%netscape.com
7097d190f2 bulletproofing for bug #15728, r=alecf
if there are no panels, just return.


git-svn-id: svn://10.0.0.236/trunk@50058 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:28:24 +00:00
sspitzer%netscape.com
f49a6fc3a9 workaround fix for #15728. r=alecf. prevent crashing when I click on the tab in the create profile wizard.
git-svn-id: svn://10.0.0.236/trunk@50057 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:24:44 +00:00
varada%netscape.com
9299843cda change customization to configs directory in checklist.ini in some files
git-svn-id: svn://10.0.0.236/trunk@50056 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:15:35 +00:00
varada%netscape.com
0925de79f3 changed customizations directory to Configs in wizardmachine.cp as well as in the checklist.ini
git-svn-id: svn://10.0.0.236/trunk@50055 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-07 00:11:01 +00:00
rogerl%netscape.com
b1873070a7 More errors-as-exceptions stuff
git-svn-id: svn://10.0.0.236/trunk@50054 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:55:33 +00:00
mcafee%netscape.com
5b962a0f3c Adding option for modeless pref dialog, ifdef'd off by default. r=akkana
git-svn-id: svn://10.0.0.236/trunk@50053 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:54:47 +00:00
sgehani%netscape.com
6b11a987a4 *** NOT PART OF BUILD ***
DEBUG symbolic constant renamed to MIW_DEBUG.


git-svn-id: svn://10.0.0.236/trunk@50052 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:52:08 +00:00
sgehani%netscape.com
d016fe35cc *** NOT PART OF BUILD ***
DEBUG symbolic constant changed from DEBUG to MIW_DEBUG.


git-svn-id: svn://10.0.0.236/trunk@50051 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:51:14 +00:00
sgehani%netscape.com
be68b07064 *** NOT PART OF BUILD ***
Cleanup of inflation routines.


git-svn-id: svn://10.0.0.236/trunk@50050 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:50:10 +00:00
sgehani%netscape.com
c45dd4d212 *** NOT PART OF BUILD ***
Disable back button on welcome window preventing user from returning to the license window.


git-svn-id: svn://10.0.0.236/trunk@50049 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:49:16 +00:00
sgehani%netscape.com
3600061916 *** NOT PART OF BUILD ***
Disk space checking is now accurate for "Custom Install".


git-svn-id: svn://10.0.0.236/trunk@50048 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:48:09 +00:00
sgehani%netscape.com
f7d9ac0919 *** NOT PART OF BUILD ***
Detect and don't download pre-existing .xpi files. Fixes bug 15695.


git-svn-id: svn://10.0.0.236/trunk@50047 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:47:02 +00:00
sgehani%netscape.com
542eeddaf1 *** NOT PART OF BUILD ***
Mouse over component now highlights and updates long description: fixes bug 14322.


git-svn-id: svn://10.0.0.236/trunk@50046 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:45:49 +00:00
harishd%netscape.com
0b8b118754 Cleaned up warnings. R=rickg
git-svn-id: svn://10.0.0.236/trunk@50044 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:24:28 +00:00
sspitzer%netscape.com
4c88fb3ec4 whoops, checked in dos formatted text files from a unix box. ran dos2unix on them to fix it. part of fix for #15402. these new files come from Ben Goodger <rgoodger@ihug.co.nz> r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@50042 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:19:53 +00:00
troy%netscape.com
75bf4aa54d b=11971, r=peterl@netscape,karnaze@netscape.com
Changed ContentInserted() to use GetFrameFor() so we target the table cell's
area frame


git-svn-id: svn://10.0.0.236/trunk@50041 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:17:28 +00:00
pavlov%netscape.com
88babc4d7b final step to make menus dismiss on unix r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50040 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 23:00:53 +00:00
akkana%netscape.com
ada22baf14 15712: Fix gtk double-click events. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@50039 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 22:57:00 +00:00
vidur%netscape.com
d46c14654b Added window.scrollBy/scrollTo/scrollX/scrollY. Scopus bug 361046. R=troy
git-svn-id: svn://10.0.0.236/trunk@50038 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 22:07:42 +00:00
sspitzer%netscape.com
578092310a remove references to xul.css, as it is no longer needed.
git-svn-id: svn://10.0.0.236/trunk@50037 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 22:07:29 +00:00
troy%netscape.com
032742ad4c Moved space manager to block frame and changed it the space manager is
temporary only during the reflow process
r=kipp@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 22:05:23 +00:00
kmcclusk%netscape.com
7c76fd51f5 r=rods; bug=15478; Added WS_EX_TOOLWINDOW extended style for popup windows
to prevent popups from creating empty task bar buttons.
bug=6061; NS_DISPLAYCHANGE event is now generated when the display depth changes
on WIN32.


git-svn-id: svn://10.0.0.236/trunk@50035 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:54:49 +00:00
norris%netscape.com
48f3a0603c More license wrangling: fix the release date (1999, not 1998).
git-svn-id: svn://10.0.0.236/trunk@50031 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:52:17 +00:00
sspitzer%netscape.com
20945ad3ee remove unused code, now that CreateNewProfile() takes two arguments
git-svn-id: svn://10.0.0.236/trunk@50030 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:52:02 +00:00
rpotts%netscape.com
b286c0c010 Removed dead code inside of #if 0 blocks...
git-svn-id: svn://10.0.0.236/trunk@50026 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:43:21 +00:00
sspitzer%netscape.com
9c68bc61cc fix the create profile wizard ui.
this work was done by the almighty Ben Goodger <rgoodger@ihug.co.nz>
r=sspitzer
I did a little clean up, and made it so show the native file path


git-svn-id: svn://10.0.0.236/trunk@50025 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:36:59 +00:00
jband%netscape.com
cd534a023e - the rest of the fix for bug 14738 - detect JSErrors with
JSErrorReports when thrown as exceptions. Extract JSErrorReport
and convert to an xpcexception. This restores functionality that
was whacked when JS errors-as-exceptions was enabled in the JS
engine.
- add conversion support for string-with-length as part of array
support mentioned in bug 13420. All the array stuff is basically
in with minimal testcases. More comprehensive tests need to be
written to verify and tune the code.
- fix a broken #undef
- switch to using PR_Alloc/PR_Free internally in nsjsid where we
were using new/delete before. This is prompted by warren's change
to nsID::ToString that uses PR_Alloc were before it used new.
This fixes an alloc/delete mismatch detected by Purify.
r=mccabe


git-svn-id: svn://10.0.0.236/trunk@50024 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:35:27 +00:00
sspitzer%netscape.com
ac743ecce8 fix for #15197 (and a whole bunch of duplicates).
fix by vidur, r=rogerl


git-svn-id: svn://10.0.0.236/trunk@50023 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:31:34 +00:00
neeti%netscape.com
68ccc3d94a updating status. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@50022 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:13:38 +00:00
norris%netscape.com
cedec739aa Fix another portion of 13192 Mozilla is "oversecured" and does not allow access to documents in the same domain
Reviewed by vidur.


git-svn-id: svn://10.0.0.236/trunk@50021 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:13:37 +00:00
norris%netscape.com
cd59845c25 Fix 15618 [CRASH] JS assertion on table regression test
Reviewed by rogerl@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50020 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:12:21 +00:00
waterson%netscape.com
84fb96cb65 Bug 13910. Fix flash panel style rules, XUL, and JS so that flashes start to display again. r=slamm.
git-svn-id: svn://10.0.0.236/trunk@50019 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:08:50 +00:00
neeti%netscape.com
6b2d99d685 updating status. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@50018 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:07:30 +00:00
beard%netscape.com
e6c61c5ffe added EcmaError.java, NativeError.java
git-svn-id: svn://10.0.0.236/trunk@50017 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:07:04 +00:00
neeti%netscape.com
b84f7a78de updating status. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@50016 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 21:05:25 +00:00
neeti%netscape.com
f6d3593b2e updating status. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@50015 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:58:41 +00:00
sspitzer%netscape.com
d6ec571916 make sure we save the prefs when we exit. will fix a bunch of problems, including #15705. r=alecf, a=leaf
git-svn-id: svn://10.0.0.236/trunk@50014 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:52:50 +00:00
gagan%netscape.com
a378b87978 Partial checkins for fixing bug # 10333. Added the nsIStatusCodeEventSink for conveying status codes to the UI thread from the socket ones. r=mscott,a=don
git-svn-id: svn://10.0.0.236/trunk@50013 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:50:12 +00:00
norris%netscape.com
734f2fb55c Update contributors, add some license text.
git-svn-id: svn://10.0.0.236/trunk@50012 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:50:04 +00:00
cbegle%netscape.com
4cdb11b194 tests for javascript errors as exceptions, a feature that was recently
added to the javascript engine.

not part of the build.


git-svn-id: svn://10.0.0.236/trunk@50011 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:45:44 +00:00
gagan%netscape.com
7258a74fc0 added files: mozilla/netwerk/base/public/nsIStatusCodeEventSink.idl
git-svn-id: svn://10.0.0.236/trunk@50010 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:44:23 +00:00
terry%mozilla.org
944a16f933 Wow. Turns out this stuff would only handle 10 products. Did the
cheap fix that lets it handle 1000 products.


git-svn-id: svn://10.0.0.236/trunk@50009 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:37:37 +00:00
neeti%netscape.com
3b3d0e4e1b updating status. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@50008 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:36:28 +00:00
vidur%netscape.com
f614c92aba Added document.width/document.height to nsIDOMNSDocument. Bug 961. R: troy
git-svn-id: svn://10.0.0.236/trunk@50007 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:33:58 +00:00
vidur%netscape.com
e16887dc96 Implemented document.width/document.height by looking at the dimensions of the view of the frame of the document element. Bug 961. R: troy
git-svn-id: svn://10.0.0.236/trunk@50006 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:32:49 +00:00
putterman%netscape.com
12980882c5 Added constructor/destructor counting macros for various mailnews
classes.  reviewed by bienvenu.  no bug.


git-svn-id: svn://10.0.0.236/trunk@50005 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:32:25 +00:00
buster%netscape.com
1e0b48570c fixed some space leaks reported by kipp. no bug #, r=tague
added some assertions and error checking to nsEditor::Do, no bug #, r=kin
fixed bug 14898 (implemented type-in state for any context), r=jfrancis


git-svn-id: svn://10.0.0.236/trunk@50004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:27:41 +00:00
ramiro%netscape.com
3412f4f935 Take myself out of the "you suck" list. r=dp
git-svn-id: svn://10.0.0.236/trunk@50003 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:22:23 +00:00
mscott%netscape.com
9baa358bf2 No Bug #.......removing an obsolete file that isn't part of the build
r=valeski


git-svn-id: svn://10.0.0.236/trunk@50002 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:21:35 +00:00
bienvenu%netscape.com
9b0345f34f fix leak of accounts, mail session r=scottip bug 000
git-svn-id: svn://10.0.0.236/trunk@50000 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:00:27 +00:00
jfrancis%netscape.com
0209785bbb revised rules system api to include "handled" parameter and ceased to overload the meaning of the "cancel" parameter; added TypedText() method to editor, editorshell, and logging, so that logging will work properly with typing; coallesce deletions for undo purposes r=buster@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49999 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:34:09 +00:00
srinivas%netscape.com
7ef083b590 Backed out previous checkin.
git-svn-id: svn://10.0.0.236/trunk@49996 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:33:52 +00:00
srinivas%netscape.com
97336400bc Previous change backed out.
git-svn-id: svn://10.0.0.236/trunk@49995 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:31:17 +00:00
srinivas%netscape.com
a633fa30b6 Backout previous change.
git-svn-id: svn://10.0.0.236/trunk@49994 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:30:01 +00:00
dmose%mozilla.org
52a561a9c0 removing obsolete doc file; a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@49993 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:17:56 +00:00
terry%mozilla.org
45c9c2b5a6 Missing some whitespace that may be vital.
git-svn-id: svn://10.0.0.236/trunk@49991 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:07:38 +00:00
srinivas%netscape.com
ea30288c1f Fixed bug in previous checkin - initialize variables before use.
git-svn-id: svn://10.0.0.236/trunk@49990 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:07:19 +00:00
harishd%netscape.com
77f9635cce Fix for Bugs
13640, 13736 - Memory leaks - R=rickg
1312 - Hooked up XHTML DOCTYPE - R=rickg
7590 - Prematuredly closing <SCRIPT> on seeing </SCRIPTERR>
2749 - Strict comment handling for noquirks mode - R=rickg
14955 - LEGEND inside FIELDSET was causing infinite looping - R=rickg,pollmann
14952 - LABEL got closed on seeing SPAN (LABEL can contain SPAN ) - R=pollmann
15381 - comment handling for XIF and HTML - R=akkana
15346 - Stray end tag caused loading blank document - R=rickg,pollmann


git-svn-id: svn://10.0.0.236/trunk@49988 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:04:29 +00:00
neeti%netscape.com
3963f45810 updating status
git-svn-id: svn://10.0.0.236/trunk@49987 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 19:01:51 +00:00
mgleeson1%netscape.com
210400fa8f r=waterson enums used in structs must be public members for HPUX
git-svn-id: svn://10.0.0.236/trunk@49986 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:56:03 +00:00
mgleeson1%netscape.com
9d0be77836 r=kipp removed unnecessary include for dlfcn.h
git-svn-id: svn://10.0.0.236/trunk@49985 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:53:41 +00:00
waterson%netscape.com
223352ad77 Comment out '_dead' renaming to get context menus working again. r=law
git-svn-id: svn://10.0.0.236/trunk@49984 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:53:32 +00:00
srinivas%netscape.com
852ba0f2aa Fixed typo in previous checkin. Also, the correct bug # is 15680.
git-svn-id: svn://10.0.0.236/trunk@49983 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:49:27 +00:00
rhp%netscape.com
58d7842b20 Changes for Bug #13512 - Reviewer: Bienvenu
git-svn-id: svn://10.0.0.236/trunk@49982 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:35:16 +00:00
srinivas%netscape.com
bf992aac1f Add the SO_BROADCAST option. Bug #365862.
git-svn-id: svn://10.0.0.236/trunk@49981 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:31:22 +00:00
bienvenu%netscape.com
ba3a9ad68c use nsIModule for factory, r=rhp bug 000
git-svn-id: svn://10.0.0.236/trunk@49980 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 18:30:35 +00:00
norris%netscape.com
522636a5de Make sure creation of class loader is inside a try block to handle security exceptions.
git-svn-id: svn://10.0.0.236/trunk@49979 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 17:39:48 +00:00
valeski%netscape.com
6f9ef9e6d4 r=warren, 15457. Added file extension attribute to URL implementations
git-svn-id: svn://10.0.0.236/trunk@49977 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 14:36:22 +00:00
pavlov%netscape.com
a1c9b6dcaa get CaptureRollupEvents working properly on unix. Fix focus problem that was being caused by grabbing the focus via SetFocus(). Fix potential crash in OnRealize(). fixes 15169, 15537, 15470 r=rods (for focus parts) r=blizzard@redhat.com (for all of it)
git-svn-id: svn://10.0.0.236/trunk@49974 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 14:04:05 +00:00
pavlov%netscape.com
743ccfad5b ifdef out the call to CaptureMouse since it is no longer needed r=rods
git-svn-id: svn://10.0.0.236/trunk@49973 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 13:36:39 +00:00
warren%netscape.com
055d89c0e3 Updating xpcom registry usage as per edburns@acm.org and dp's suggestions.
git-svn-id: svn://10.0.0.236/trunk@49972 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 09:57:50 +00:00
brendan%mozilla.org
3188df57a2 Fix Object.prototype.toSource so it parenthesizes outermost-toSource literals for eval roundtrips.
git-svn-id: svn://10.0.0.236/trunk@49971 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 09:09:31 +00:00
warren%netscape.com
bf35f71ce1 Fixed nsCOMPtr bustage.
git-svn-id: svn://10.0.0.236/trunk@49970 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 09:03:43 +00:00
warren%netscape.com
49e47e3066 Fixed build warnings.
git-svn-id: svn://10.0.0.236/trunk@49969 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 08:51:48 +00:00
warren%netscape.com
30cf63de80 Added AsyncOpen to nsIChannel for URL dispatching. Added ContentLength to InputStreamChannel. (r=rpotts,valeski)
git-svn-id: svn://10.0.0.236/trunk@49968 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 08:26:01 +00:00
dougt%netscape.com
3e9e75feec Fix for 11812. Reordered the clean up so that deletion of the "real" object
happens after NS_RELEASE of the proxy object.  This is a test program.

reviewed by gagan.


git-svn-id: svn://10.0.0.236/trunk@49967 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 08:17:04 +00:00
warren%netscape.com
ccc05991a3 added files: mozilla/netwerk/base/public/nsIFileSystem.idl
git-svn-id: svn://10.0.0.236/trunk@49966 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 08:16:48 +00:00
gagan%netscape.com
c39e2405d9 An event sink to transfer status codes to a consumer of necko.
This is not in the build as yet.


git-svn-id: svn://10.0.0.236/trunk@49965 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 07:49:32 +00:00
mcafee%netscape.com
478e94b19b Removing unnecessary label rule that was making prefs look like crap. Thanks to pavlov for this fix. r=pavlov,myself
git-svn-id: svn://10.0.0.236/trunk@49964 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 07:45:05 +00:00
warren%netscape.com
541b381b71 Added nsIFileSystem interface for new file transport implementation.
git-svn-id: svn://10.0.0.236/trunk@49963 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 07:27:22 +00:00
ftang%netscape.com
0851c72b83 fix bug 15647 r=sdagley. Swap progid base between ENCODER/DECODER
git-svn-id: svn://10.0.0.236/trunk@49962 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 07:11:40 +00:00
pavlov%netscape.com
644f5864a9 initial work on unix installer
git-svn-id: svn://10.0.0.236/trunk@49961 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:59:20 +00:00
waterson%netscape.com
c4175bcb0e Fix incorrect use of CBufDescriptor that was causing persistence to flake.
git-svn-id: svn://10.0.0.236/trunk@49960 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:42:27 +00:00
waterson%netscape.com
58cd4c0ef8 Suppress assertions with context menus for now.
git-svn-id: svn://10.0.0.236/trunk@49959 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:40:06 +00:00
brendan%mozilla.org
a17b679975 Top-level ToSource function for primitive type roundtrips.
git-svn-id: svn://10.0.0.236/trunk@49958 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:37:55 +00:00
brendan%mozilla.org
e8d09fd3a6 Fix two multi-threaded GC-rooting bugs:
- js_NewFunction wasn't initializing (clearing) JSFunction members before it
  linked the JSFunction to a JSObject that the GC could reach from a root.
- Make sure frame.scopeChain is cleared before linking frame via cx->fp, even
  though we set frame.scopeChain to some object later (another signal that we
  should rework js_Invoke to inline it and otherwise optimize it).


git-svn-id: svn://10.0.0.236/trunk@49957 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:29:43 +00:00
mscott%netscape.com
ccf2994b95 (not part of the build!)
just add a new line to the end of the file....


git-svn-id: svn://10.0.0.236/trunk@49956 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:21:40 +00:00
mscott%netscape.com
7277b119b3 Bug #15655 --> new file for mime to use nsIModule. This is not part of the build and has not been reviewed yet. The review will happen
when I land all the rest of the changes related to converting mime to use nsIModule.


git-svn-id: svn://10.0.0.236/trunk@49955 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 06:00:40 +00:00
rpotts%netscape.com
c0d2a0e2f2 bug #15605. Reviewed by nisheeth. Check the return code from GoToAnchor(...) :-)
git-svn-id: svn://10.0.0.236/trunk@49954 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 05:15:13 +00:00
jefft%netscape.com
347134e10d fixed bug 15291 - Pop3 local mail folder message lines not ended with platform specific line endings; replacing CRLF with platform specific MSG_LINEBREAK; reviewed by bienvenu, mscott
git-svn-id: svn://10.0.0.236/trunk@49953 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 04:56:02 +00:00
neeti%netscape.com
2eb2dcca67 updating status
git-svn-id: svn://10.0.0.236/trunk@49952 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 04:47:08 +00:00
bienvenu%netscape.com
9446096dca fix ref count tracing for composite data source bug 666 n/a r=waterson
git-svn-id: svn://10.0.0.236/trunk@49951 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 04:45:14 +00:00
neeti%netscape.com
7362f1b13f Converted wallet.dll and wlltvwrs.dll to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=morse
git-svn-id: svn://10.0.0.236/trunk@49950 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 04:42:59 +00:00
troy%netscape.com
148aeb9479 Space issue. r=kipp@netscape.com
Replaced hash table which used lots of memory with simple linked list of
FrameInfo* structs


git-svn-id: svn://10.0.0.236/trunk@49949 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 04:22:51 +00:00
karnaze%netscape.com
89bd8c3bc9 fixed assertion in viewer sample 4. AdjustForCollapsingCols was incorrectly counting as columns frames which were not of display type NS_STYLE_DISPLAY_TABLE_COLUMN and something must have changed elsewhere to tickle this.
git-svn-id: svn://10.0.0.236/trunk@49948 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:59:07 +00:00
ramiro%netscape.com
f3bc03de75 Im an idiot, i applied the same patch twice. Sorry. Backout my last change.
git-svn-id: svn://10.0.0.236/trunk@49947 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:38:49 +00:00
rjc%netscape.com
d69298a9d2 Fix broken XUL. Review: sdagley
git-svn-id: svn://10.0.0.236/trunk@49946 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:33:28 +00:00
mscott%netscape.com
417b06f591 Bug #000 (no bug needed). Remove nsIStreamConverter2.idl.
r=valeski


git-svn-id: svn://10.0.0.236/trunk@49945 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:27:55 +00:00
mscott%netscape.com
9fce7b0c15 Bug #0000 (no bug # needed) remove nsIStreamConverter2.idl
r=valeski


git-svn-id: svn://10.0.0.236/trunk@49944 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:27:15 +00:00
mscott%netscape.com
e7538bfe37 bug #000 (no bug # needed). removing obsolete file from the build
nsIStreamconverter2.idl
r=valeski


git-svn-id: svn://10.0.0.236/trunk@49943 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:21:44 +00:00
mscott%netscape.com
9c726938af Bug #000 (no bug number needed) remove an obsolete file from the build (nsIStreamConverter2.idl)
r=valeski


git-svn-id: svn://10.0.0.236/trunk@49942 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:20:39 +00:00
rjc%netscape.com
bed7f86409 Update leak docs. (Not part of build.)
git-svn-id: svn://10.0.0.236/trunk@49941 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 03:00:06 +00:00
valeski%netscape.com
7a33492452 r=sdagley, 15654 was deleting a void * which is a no-no on hp.
git-svn-id: svn://10.0.0.236/trunk@49940 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 02:54:49 +00:00
sfraser%netscape.com
08f88ab066 Fix the file creator code so that the library gets the nice pretty icon. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49939 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 02:38:35 +00:00
sdagley%netscape.com
9fc68e8c6c Add documentation comments for Mac library loading. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49937 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 02:37:14 +00:00
dmose%mozilla.org
a81253b229 new version of LICENSE; not part of the build
git-svn-id: svn://10.0.0.236/trunk@49936 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 02:14:51 +00:00
waterson%netscape.com
0d44d897c3 Fix leaking rowgroup frame. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@49935 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:50:14 +00:00
mgleeson1%netscape.com
8e1de98ab5 r=kipp changed illegal escape \{ to {
git-svn-id: svn://10.0.0.236/trunk@49934 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:41:38 +00:00
varada%netscape.com
011f173694 fix to bug #15327 adding MinLen field to the edit widget
git-svn-id: svn://10.0.0.236/trunk@49933 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:38:02 +00:00
rjc%netscape.com
2ffbb4f583 Bug #14034: Convert to nsIModule to prepare for memory leak fixing. Also fix leak of search stream listener. Review: sdagley@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49932 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:37:47 +00:00
hangas%netscape.com
6563efab51 Porkjocky: .xul file troubleshooting. Removed duplicate references to css files within the same windows for performance. Wrapped another tree in a <div> to avoid scrolling issues. r=davidm
git-svn-id: svn://10.0.0.236/trunk@49931 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:35:36 +00:00
varada%netscape.com
c70061dbb3 Bug fix for #15327 - determination of length of edit fields
git-svn-id: svn://10.0.0.236/trunk@49930 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:32:00 +00:00
sfraser%netscape.com
a591a0e509 Fix access paths to not look for lib/xp. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49929 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:21:23 +00:00
sfraser%netscape.com
6dd1042b5d Don't export headers in lib/mac/MacMemoryAllocator any more. NSPR no longer needs the one that was being exported. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49928 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:20:44 +00:00
sfraser%netscape.com
b98dbfaa02 Fixed access paths to remove lib/xp, and mozilla/include. xp_regexp.h is now exported, and found in dist. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49927 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:19:58 +00:00
sfraser%netscape.com
3e38e2ea2a Export xp_regexp.h, for libjar. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49926 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:19:18 +00:00
sfraser%netscape.com
cb8f332910 Changed to export using the .exp file, to reduce link warnings. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49924 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:17:56 +00:00
sfraser%netscape.com
32644723fe First Checked In.
git-svn-id: svn://10.0.0.236/trunk@49923 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:17:19 +00:00
dp%netscape.com
25f4419ba0 updating status
git-svn-id: svn://10.0.0.236/trunk@49920 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:09:54 +00:00
sfraser%netscape.com
c4429f5066 Change Mac library loading to load using the FSSpec. r=dp
git-svn-id: svn://10.0.0.236/trunk@49919 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:09:13 +00:00
sdagley%netscape.com
15caf3db1c New calls to load code fragments by name or index, and utility routines for getting fragment names from the 'cfrg' resource. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49918 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:07:15 +00:00
sdagley%netscape.com
d89dab4e33 Added #define NSPR_AS_SHARED_LIB to avoid (never called) MacInitializeMemory. This is just tidy up. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49917 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:06:27 +00:00
sdagley%netscape.com
6e8fa75abe New implementations of PR_LoadNamedFragment and PR_LoadIndexedFragment, which now allow loading libraries by FSSpec. Mac only. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49916 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:05:33 +00:00
sdagley%netscape.com
b9147e6fd2 Added prlink_mac.h, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49915 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:04:06 +00:00
sdagley%netscape.com
35708ce998 Included some new header files, so that building with 'require function prototypes' works better. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49914 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:03:00 +00:00
waterson%netscape.com
d48f50c349 Fix dumb leak.
git-svn-id: svn://10.0.0.236/trunk@49913 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:02:11 +00:00
sdagley%netscape.com
190716d4ac First Checked In.
git-svn-id: svn://10.0.0.236/trunk@49912 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 01:00:58 +00:00
rogerl%netscape.com
74e6cc86a3 Added version 150, changed version testing in regexp
git-svn-id: svn://10.0.0.236/trunk@49911 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 00:10:27 +00:00
waqar%netscape.com
b576ab2cb5 # 9777
r vidur
d When splitText has an index error, it used to send NS_ERROR not it sends
  the proper DOM index size error.


git-svn-id: svn://10.0.0.236/trunk@49910 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 00:06:53 +00:00
tao%netscape.com
c9f9d5ee25 Add flags to selectively build subdirectories.
git-svn-id: svn://10.0.0.236/trunk@49909 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 00:03:37 +00:00
kipp%netscape.com
3a0fa24595 Cleanup special viewers too
git-svn-id: svn://10.0.0.236/trunk@49908 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 00:00:18 +00:00
kipp%netscape.com
be0faff780 Implement ShowContentSize; fixed a bug where we weren't removing the browser window as a doc-loader observer which sometimes triggers a crash when the -f argument to the viewer is used
git-svn-id: svn://10.0.0.236/trunk@49907 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:59:59 +00:00
cata%netscape.com
7b445faf02 added files: mozilla/intl/uconv/ucvtw2/nsUCvTw2Module.cpp, removed files: mozilla/intl/uconv/ucvtw2/nsUCvTW2Dll.cpp
git-svn-id: svn://10.0.0.236/trunk@49906 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:58:49 +00:00
morse%netscape.com
3f799e031d fix bug 15572, clean up build warnings, reviewed slamm
git-svn-id: svn://10.0.0.236/trunk@49905 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:58:45 +00:00
kipp%netscape.com
71408231d2 Tweaked refcnt munging to better support refcnt tracking
git-svn-id: svn://10.0.0.236/trunk@49904 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:58:32 +00:00
kipp%netscape.com
3a3369076f Fixed a memory leak of widgets triggered when the close box for a window is hit
git-svn-id: svn://10.0.0.236/trunk@49903 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:57:57 +00:00
cata%netscape.com
934632fc76 added files: mozilla/intl/uconv/ucvtw/nsUCvTwModule.cpp, removed files: mozilla/intl/uconv/ucvtw/nsUCvTWDll.cpp
git-svn-id: svn://10.0.0.236/trunk@49902 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:57:29 +00:00
kipp%netscape.com
bdf07b5f16 Work around a flaw in the doc-loader not handling a RemoveObserver call during an observer notification
git-svn-id: svn://10.0.0.236/trunk@49901 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:57:20 +00:00
morse%netscape.com
f082f7eb5e fix bug 15572, fix up build warnings, reviewed slamm
git-svn-id: svn://10.0.0.236/trunk@49900 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:56:59 +00:00
kipp%netscape.com
2f507e7b3c Improved printouts so that addref/release tracing always shows the old/new refcnts in decimal instead of old in decimal and new in hex
git-svn-id: svn://10.0.0.236/trunk@49899 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:56:33 +00:00
cata%netscape.com
b18dd56b44 added files: mozilla/intl/uconv/ucvlatin/nsUCvLatinModule.cpp, removed files: mozilla/intl/uconv/ucvlatin/nsUCvLatinDll.cpp
git-svn-id: svn://10.0.0.236/trunk@49898 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:56:08 +00:00
cata%netscape.com
bfa9612c50 Converting library to Module. Bug 15589. Reviewed by dp.
git-svn-id: svn://10.0.0.236/trunk@49897 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:54:18 +00:00
kipp%netscape.com
71a5f24ba3 Implemented suggested change so that leak info is printed if an env variable is used
git-svn-id: svn://10.0.0.236/trunk@49896 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:54:08 +00:00
cata%netscape.com
b8d939ca6e added files: mozilla/intl/uconv/ucvko/nsUCvKoModule.cpp, removed files: mozilla/intl/uconv/ucvko/nsUCvKODll.cpp
git-svn-id: svn://10.0.0.236/trunk@49895 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:53:21 +00:00
cata%netscape.com
28fb79fcef added files: mozilla/intl/uconv/ucvja/nsUCvJaModule.cpp, removed files: mozilla/intl/uconv/ucvja/nsUCVJADll.cpp
git-svn-id: svn://10.0.0.236/trunk@49894 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:51:46 +00:00
ducarroz%netscape.com
869cfacaf7 related to bug 14561, fix some other case where we didn't bring back errors while sending message. R=rhp
git-svn-id: svn://10.0.0.236/trunk@49893 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:48:40 +00:00
dmose%mozilla.org
79a8db9e5d updating NPL boilerplate to 1.1; only comments changed
git-svn-id: svn://10.0.0.236/trunk@49892 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:48:08 +00:00
kipp%netscape.com
53b538cfc8 Support SizeOf methods
git-svn-id: svn://10.0.0.236/trunk@49891 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:47:46 +00:00
hangas%netscape.com
efca1f8c77 Fix bug 13729 for putterman/hyatt. Tree headers not always displaying on Mac/Linux. Commented out optimization in Reflow(). r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@49890 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:46:16 +00:00
mcafee%netscape.com
28e1dfd154 removing redundant xul: tags, minor whitespace stuff. r=slamm
git-svn-id: svn://10.0.0.236/trunk@49889 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:44:41 +00:00
pollmann%netscape.com
1c6394c2d0 Bug 15170: Implement onchange notification for list boxes
git-svn-id: svn://10.0.0.236/trunk@49888 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:43:06 +00:00
mcafee%netscape.com
4518901d71 xul: is redundant in xul files. r=slamm
git-svn-id: svn://10.0.0.236/trunk@49887 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:40:07 +00:00
rjc%netscape.com
31eba671e2 Bug # 14034: Convert to nsIModule to prepare for memory leak fixing. Review: dp@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49886 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:39:48 +00:00
danm%netscape.com
08ffd64c70 Release XP menu rollup listener before menu is executed. This restores normal event handling earlier. Fixes bug 15596. r:hyatt
git-svn-id: svn://10.0.0.236/trunk@49884 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:31:06 +00:00
selmer%netscape.com
149b556a40 new fn definitions
git-svn-id: svn://10.0.0.236/trunk@49883 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:18:35 +00:00
selmer%netscape.com
12bc995595 Removed temporary 'NewConfig' fix in favor of real fix
git-svn-id: svn://10.0.0.236/trunk@49882 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:18:12 +00:00
selmer%netscape.com
ab205b541a Fix dialogs a little (more required) and fix handling of GlobalArrayIndex
git-svn-id: svn://10.0.0.236/trunk@49881 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:17:07 +00:00
selmer%netscape.com
b51d6a324e Updates to make all functions go through 'command' except generatelist and installbuilder (fix those later)
git-svn-id: svn://10.0.0.236/trunk@49880 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:15:49 +00:00
ramiro%netscape.com
f037c3b791 Fix for bug 15245. Rearrange the inclusion of system headers to unbreak
some unix compilers.  Patch provided by tor@cs.brown.edu and reviewed by me.


git-svn-id: svn://10.0.0.236/trunk@49879 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 23:08:19 +00:00
varada%netscape.com
040d9254e3 moving branding_page4.ini to the page before the installer page bug 11342
git-svn-id: svn://10.0.0.236/trunk@49878 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:57:18 +00:00
cata%netscape.com
230b7ea144 Fix my Unix breakage.
git-svn-id: svn://10.0.0.236/trunk@49877 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:33:09 +00:00
waterson%netscape.com
495ac5394c Fix crasher when loading XUL in viewer and no localstore is present.
git-svn-id: svn://10.0.0.236/trunk@49876 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:22:40 +00:00
rhp%netscape.com
3924a3e115 Fix for my screw up...sorry about this.
git-svn-id: svn://10.0.0.236/trunk@49875 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:15:43 +00:00
rogerl%netscape.com
ac914fc99e Bug #14545 - get array length exceptions working with non-Number array
contructor arguments.


git-svn-id: svn://10.0.0.236/trunk@49874 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:11:57 +00:00
waterson%netscape.com
33cab018e9 Bug 13910. Make sure we push the 'NC:description' attribute. r=dougt
git-svn-id: svn://10.0.0.236/trunk@49873 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:11:44 +00:00
morse%netscape.com
e03ce189b4 fix bug 14889, lazy initialization of wallet, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49872 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:11:22 +00:00
mscott%netscape.com
b605bcf7c8 Bug #15583 --> fix warning (unused variable)
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49871 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:03:50 +00:00
sspitzer%netscape.com
2e1f51d842 fix for #15617. always save prefs after migration. not sure why prefs aren't being saved anymore, but this is a good idea. r=mscott
git-svn-id: svn://10.0.0.236/trunk@49870 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 22:02:58 +00:00
cata%netscape.com
e532cb3ce3 added files: mozilla/intl/uconv/ucvcn/nsUCvCnModule.cpp, removed files: mozilla/intl/uconv/ucvcn/nsUCvCnDll.cpp
git-svn-id: svn://10.0.0.236/trunk@49869 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:26:47 +00:00
cata%netscape.com
6278c9cdb6 Converting library to Module. Bug 15589. Reviewed by dp.
git-svn-id: svn://10.0.0.236/trunk@49868 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:25:47 +00:00
dougt%netscape.com
08e25e2af2 1) Adding an eventsinkgetter interface so that when 13894 become unblocked (when gagan
checks in his protocol messages)  we will automatically get onStatus and onProgress
notification.  reviewed by dveditz.


git-svn-id: svn://10.0.0.236/trunk@49867 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:18:48 +00:00
rhp%netscape.com
9230e0bd2b Fix for #14120 - Reviewer - bienvenu
git-svn-id: svn://10.0.0.236/trunk@49866 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:17:17 +00:00
dougt%netscape.com
f10ff94359 Change pref name
Added Preferences for software notification timer (see 14729) r. samir g.


git-svn-id: svn://10.0.0.236/trunk@49865 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:15:30 +00:00
dougt%netscape.com
699606d62a set software notification timer to once per week. 14729 R. sgehani
Update pref name


git-svn-id: svn://10.0.0.236/trunk@49864 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:14:13 +00:00
waterson%netscape.com
b4e6b84fea Bug 15301. Remove RDF graph from XUL content model construction. Landed XUL_19991005_BRANCH; see branch comments for detailed checkin information. r=shaver,hyatt.
git-svn-id: svn://10.0.0.236/trunk@49863 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:13:55 +00:00
jband%netscape.com
32816676db the JS engine part of the fix for bug 14738. This does two things: 1) expose the JSClass for JSError so that it is possible to detect from the outside if a given JSObject is of that JSError class, and 2) expose an api call via which the JSErrorReport can be extracted from a JSError (if present). This change required renaming the JSClass used for JSError, so many lines were touched
git-svn-id: svn://10.0.0.236/trunk@49861 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 21:07:23 +00:00
mscott%netscape.com
dfe61b8c0c Bug #0000 (no bug number necessary). remove old STREAM_CONVERTER_HACK #ifdef code because we no longer need this.
This was the hack we used before we had a stream converter service to load rfc822 data into a webshell and get it
converted to html.
r=warren


git-svn-id: svn://10.0.0.236/trunk@49856 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:54:03 +00:00
neeti%netscape.com
23d28fee69 Not part of the build. Took some more dlls for conversion to use nsImodule
git-svn-id: svn://10.0.0.236/trunk@49855 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:49:20 +00:00
sspitzer%netscape.com
185c444bad fix for #15610, alert on failure to rename or delete a profile. r=mscott
git-svn-id: svn://10.0.0.236/trunk@49854 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:49:09 +00:00
hangas%netscape.com
bb00d4e082 Fixing bug 13443 (crash scrolling results pane of address book), added <html:div> around the trees as per Hyatt's suggestion which Scottip reminded me of today. r=scottip
git-svn-id: svn://10.0.0.236/trunk@49853 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:49:08 +00:00
mscott%netscape.com
bc20c13bee Bug #14739 --> fix use of unitiailized variable.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49852 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:48:37 +00:00
sspitzer%netscape.com
0685d4013e remove work around for #15458. that bug has been fixed.
gayatrib and I both tested it.


git-svn-id: svn://10.0.0.236/trunk@49851 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:47:41 +00:00
varada%netscape.com
6c0dabbcc9 Validation for .nci in the entry field during creation of NCI files
git-svn-id: svn://10.0.0.236/trunk@49849 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 20:30:20 +00:00
rogerl%netscape.com
51378fb74f Errors as exceptions working from generated code.
git-svn-id: svn://10.0.0.236/trunk@49848 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 19:44:24 +00:00
sspitzer%netscape.com
ae215e19d6 fix for #15578, r=mscott, a=granrose, fix crash on startup.
not sure why we don't have a webshell here...


git-svn-id: svn://10.0.0.236/trunk@49846 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 18:13:15 +00:00
sspitzer%netscape.com
2aa4acab95 fix for #15578, r=mscott, a=granrose
properly migrate the bookmarks file on windows.


git-svn-id: svn://10.0.0.236/trunk@49845 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 18:10:20 +00:00
kipp%netscape.com
8626b336eb Added ctor/dtor counting to the parser tokens
git-svn-id: svn://10.0.0.236/trunk@49842 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 15:00:05 +00:00
kipp%netscape.com
feff21ed38 r=jband; fixed a memory leak
git-svn-id: svn://10.0.0.236/trunk@49841 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:56:41 +00:00
kipp%netscape.com
ebce0e90ac Renamed the ctor/dtor counting macros to make more sense
git-svn-id: svn://10.0.0.236/trunk@49840 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:54:05 +00:00
kipp%netscape.com
a87258a834 Added in ctor/dtor counting
git-svn-id: svn://10.0.0.236/trunk@49839 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:53:40 +00:00
kipp%netscape.com
bcb12509a4 r=dp; Added in ctor/dtor counting
git-svn-id: svn://10.0.0.236/trunk@49838 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:53:20 +00:00
kipp%netscape.com
54966bf91e r=beard; Added in ctor/dtor counting
git-svn-id: svn://10.0.0.236/trunk@49837 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:52:53 +00:00
kipp%netscape.com
011094c243 r=peterl; Added in ctor/dtor counting
git-svn-id: svn://10.0.0.236/trunk@49836 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:52:20 +00:00
jefft%netscape.com
dc5a959bfb fixed bug 15556 - treat forward quoted as inline; default to forward as attachment if get pref failed; reviewed rhp
git-svn-id: svn://10.0.0.236/trunk@49835 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:52:19 +00:00
kipp%netscape.com
8fdcb733f6 Removed static ctors
git-svn-id: svn://10.0.0.236/trunk@49834 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:51:56 +00:00
kipp%netscape.com
a4aa98059e r=troy; Added in ctor/dtor counting
git-svn-id: svn://10.0.0.236/trunk@49833 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:51:12 +00:00
kipp%netscape.com
beb412d2f0 r=troy; Added some atoms to help eliminate global ctors
git-svn-id: svn://10.0.0.236/trunk@49832 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:51:02 +00:00
kipp%netscape.com
cd7adcfa5b r=troy; Removed some of my own debug noise
git-svn-id: svn://10.0.0.236/trunk@49831 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:50:30 +00:00
kipp%netscape.com
ddfb13e8bd whitespace noise
git-svn-id: svn://10.0.0.236/trunk@49830 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:50:06 +00:00
kipp%netscape.com
6455b470d5 Whitespace tweak
git-svn-id: svn://10.0.0.236/trunk@49829 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:48:58 +00:00
kipp%netscape.com
2e0f295a75 Added in a way to shutdown the image manager
git-svn-id: svn://10.0.0.236/trunk@49828 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:48:44 +00:00
kipp%netscape.com
0fe83f199b Remove some compiler warnings
git-svn-id: svn://10.0.0.236/trunk@49827 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:48:01 +00:00
jefft%netscape.com
3bf966446e fixed bug 9540, 10827, 11991 - copy news article failed on certain platforms; replacing CRLF to platform specific MSG_LINEBREAK; reviewed by mscott
git-svn-id: svn://10.0.0.236/trunk@49823 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:20:15 +00:00
jefft%netscape.com
d280db659f fixed bug 9540, 10827, 11991 - copy news article failed on certain platforms; replacing CRLF to platform specific MSG_LINEBREAK; reviewed by mscott
git-svn-id: svn://10.0.0.236/trunk@49822 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 14:15:04 +00:00
rpotts%netscape.com
52fa2d449f Added a missing lock to nsSocketTransport::OnFull... reviewed by warren.
git-svn-id: svn://10.0.0.236/trunk@49820 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 08:41:37 +00:00
rpotts%netscape.com
bd2b8bbb50 bug #14181. Reviewed by pnunn. Fixed crash when loading large (or slow) animated GIF images on linux.
git-svn-id: svn://10.0.0.236/trunk@49819 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 08:36:43 +00:00
mscott%netscape.com
9540a1b2bb fix vc5.0 build......include nsISupportsArray before using a com ptr on it.
git-svn-id: svn://10.0.0.236/trunk@49818 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 06:56:12 +00:00
dp%netscape.com
a4303afba6 Fixed build bustage caused by undefined min()
git-svn-id: svn://10.0.0.236/trunk@49817 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 06:28:17 +00:00
mscott%netscape.com
3f98b22adb Bug #0000 --> (no bug necessary)....add a #ifdef guard around this header file
so we don't try to include the contents multiple times!!
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49816 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:53:31 +00:00
rickg%netscape.com
3f9c7372e6 no changes made; just forcing a recompile
git-svn-id: svn://10.0.0.236/trunk@49815 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:52:12 +00:00
mscott%netscape.com
628723cd09 Bug #11837 use NS_GENERIC_FACTORY_CONSTRUCTOR, remove NS_New**
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49813 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:46:20 +00:00
mscott%netscape.com
d84901b036 Bug #11837 use NS_GENERIC_FACTORY_CONSTRUCTOR for our components
the factory should cache nsIGenericFactory objects for each
component we know how to produce.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49812 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:45:07 +00:00
mscott%netscape.com
c12b68d3bc Bug #11837 --> in order to use NS_GENERIC_FACTORY_CONSTRUCTOR the
class declaration needs to be in the header file. Removing old NS_New*
method in favor of NS_GENERIC_FACTORY_CONSTRUCTOR.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49811 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:44:41 +00:00
sspitzer%netscape.com
7159500167 added files: mozilla/profile/src/nsProfileFactory.cpp
git-svn-id: svn://10.0.0.236/trunk@49810 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:20:58 +00:00
sspitzer%netscape.com
8c517b89c5 fix for #15262, r=mscott
break apart the profile factory from nsProfile.cpp and put it into nsProfileFactory.cpp
also, apply dp's patch to use nsIModule.  r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@49809 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:20:45 +00:00
pavlov%netscape.com
489535b9e0 fix bugs in find dialog and make it use the dialog overlay. make it not resizeable, fixed style rules on the windows and buttons. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@49808 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:20:29 +00:00
rjc%netscape.com
0899d7c171 Fix bug # 15435: prevent long ( > 255) URL corruption. Also convert over to a nsIModule. Review: dp@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49807 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:11:09 +00:00
rpotts%netscape.com
2c951d67c1 Fixed up broken test case while investigating bug #14181...
git-svn-id: svn://10.0.0.236/trunk@49806 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 05:02:56 +00:00
rickg%netscape.com
685d8d596e fixed bug 15290; eliminated a leak; r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@49805 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:54:53 +00:00
radha%netscape.com
ac0f716288 Fix for bug #13329 . Back and forward not consistent all the time.
Fix already checked in to the M10 branch. Merging changes to tip.


git-svn-id: svn://10.0.0.236/trunk@49804 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:49:58 +00:00
rickg%netscape.com
4a9749eec3 bugs 13038 and 14920; also improved comments. r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@49803 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:47:19 +00:00
jband%netscape.com
37f1655b17 xpidl compiler was failing to complain that it is an error to use [shared] with 'inout' params. (no bug was filed) r=mccabe
git-svn-id: svn://10.0.0.236/trunk@49802 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:23:35 +00:00
karnaze%netscape.com
aa9be56cfa bug 14818 - made standard mode like NavQuirks when handling colspans exceeding the number of columns.
git-svn-id: svn://10.0.0.236/trunk@49801 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:21:00 +00:00
putterman%netscape.com
b4b00ba592 Fix bug 15479 - crash when mousing over folder pane scrollbar. Also, fix 12645 - assertion
when using folder pane scrollbar.  Also, make 3pane menu and toolbar look normal.  various
parts reviewed by hyatt and hangas.


git-svn-id: svn://10.0.0.236/trunk@49800 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:14:26 +00:00
sspitzer%netscape.com
41337e7380 a bunch of changes, all reviewed by mscott.
fix some bugs with next, back, and cancel in the profile manager.
(#15223, #15271)
re-write all callers of nsProfile::GetCurrentProfileDir() to use the file locator.
(#15063)
more profile code clean up. (#15042)
rename the old 4.x history.dat file.  it's called history.dat in 5.0, but the file
formats are different.  (binary in 4.x, vs mork in 5.0)


git-svn-id: svn://10.0.0.236/trunk@49797 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:12:58 +00:00
norris%netscape.com
3c9599e418 Fix 15458 "onLoadHandler does not work"
Reviewed by mstoltz.


git-svn-id: svn://10.0.0.236/trunk@49796 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:08:14 +00:00
rpotts%netscape.com
fa598b6cae bug #15341 and bug #15344. Use the documentloader observer instead of a stream observer.
git-svn-id: svn://10.0.0.236/trunk@49795 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:04:16 +00:00
sgehani%netscape.com
ff7384e823 Added Mac alias creation feature for install script writers using XPInstall: bugs 9363, 14345, 15503; r=ssu.
Fixed nsFileSpec<->nsInstall error translation in File operations exposed to install script writers: bug 15486; r=ssu.


git-svn-id: svn://10.0.0.236/trunk@49794 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 04:04:01 +00:00
tao%netscape.com
9c58478520 Add makefiles for Unix.
git-svn-id: svn://10.0.0.236/trunk@49793 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 03:55:45 +00:00
mccabe%netscape.com
1664bd1228 Initial checkin of TestScan.java, a simple driver for generating and printing various kinds of parse trees, and for profiling scanning, parsing and compiling.
git-svn-id: svn://10.0.0.236/trunk@49792 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 03:47:04 +00:00
alecf%netscape.com
455a608f47 add new findServer() method and javadoc comments
r=sspitzer
#15140


git-svn-id: svn://10.0.0.236/trunk@49791 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 03:29:42 +00:00
waterson%netscape.com
0db46fd24d Bug 15511. Make sure container element sets 'parent' backpointer to null before releasing child; prevents dangling references if child is still referenced from elsewhere. r=vidur
git-svn-id: svn://10.0.0.236/trunk@49790 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 03:20:57 +00:00
sfraser%netscape.com
2306c86ff9 Use CR for line termination on Macintosh, and don't call flush() for an endl. r dougt.
git-svn-id: svn://10.0.0.236/trunk@49788 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 03:00:13 +00:00
troy%netscape.com
9598e1278f Checked in workaround for tree-view/apprunner problem of assert in GetColumnWidth()
git-svn-id: svn://10.0.0.236/trunk@49787 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 02:41:36 +00:00
selmer%netscape.com
016eba860a Most of CopyDir ready
git-svn-id: svn://10.0.0.236/trunk@49786 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 02:22:36 +00:00
kipp%netscape.com
e62c5f3e87 backed out dps erroneous fix
git-svn-id: svn://10.0.0.236/trunk@49785 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:44:35 +00:00
kipp%netscape.com
8aa6b7aa38 Fixed build wastage
git-svn-id: svn://10.0.0.236/trunk@49784 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:43:34 +00:00
dmose%mozilla.org
de7b2e5e74 update license boilerplate to NPL dual w/GPL, r=norris@netscape,a=norris@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49783 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:42:01 +00:00
shawnp%earthling.net
17b2b4cace To determine what gfx toolkit is being used at runtime, I added the
following functions to the nsIUnixToolkitService interface:
SetWidgetToolkitName(), SetGfxToolkitName(), IsValidWidgetToolkit(),
IsValidGfxToolkit(), GetWidgetToolkitName(), GetGfxToolkitName(). I also
added the implementation for these functions. Reviewed by
ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49782 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:35:21 +00:00
shawnp%earthling.net
0b401a86ba Improved info that is logged. Only bother to do something in OnPaint() if there
is a pixmap to copy from. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49781 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:31:56 +00:00
shawnp%earthling.net
8fff423963 Implemented stub CaptureRollupEvents() and SetTitle() functions. Now handle
both Qt and Xlib gfx toolkits at runtime. Fixed a bug in SetCursor(). Can now
track cursor movement when no mouse button is pressed. Got rid of flickering
when repainting web pages. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49780 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:31:18 +00:00
shawnp%earthling.net
4046113676 Now use separate PR_LOG module for scrolling. Stopped generation of double
scroll events. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49779 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:30:23 +00:00
shawnp%earthling.net
f6d25e7c68 Added mouse enter/exit event. Added focus in/out event. Now use seperate PR_LOG
modules for events. Combined MousePressedEvent() and MouseReleasedEvent() into
MouseButtonEvent(). Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49778 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:29:07 +00:00
despotdaemon%netscape.com
90d52f24b4 Pseudo-automatic update of changes made by dmose@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@49777 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:28:52 +00:00
shawnp%earthling.net
14a4b48d16 Added constructor needed for integration with Xlib gfx toolkit. Reviewed by
ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49776 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:28:24 +00:00
shawnp%earthling.net
5475d74886 Implemented stub SetCheckboxType() and GetCheckboxType() functions.
Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49775 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:27:44 +00:00
shawnp%earthling.net
aa82528d79 Implemented stub GetEnabled() and IsHelpMenu() functions. Reviewed by
ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49774 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:26:39 +00:00
kipp%netscape.com
2359272160 Disabled leak cleanup until other reviews come in
git-svn-id: svn://10.0.0.236/trunk@49773 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:26:14 +00:00
dp%netscape.com
1d765d463d Fixing build bustage.
git-svn-id: svn://10.0.0.236/trunk@49772 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:25:55 +00:00
shawnp%earthling.net
fc4c559faa Updated to better match values used by the gtk widget toolkit (assuming
those are more correct values). Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49771 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:24:46 +00:00
shawnp%earthling.net
af2c5a6328 Added a static function to determine at runtime what gfx toolkit is being
used. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49770 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:23:47 +00:00
shawnp%earthling.net
66f0536716 Now link in libxlibgrb.so when building libwidgetqt.so so that Qt can work
with the Xlib gfx toolkit. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49769 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:22:48 +00:00
shawnp%earthling.net
cdbe7612ce Added missing entries to the menus. Added key accessors for menu items that
were missing them. Reviewed by ramiro@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@49768 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 01:21:29 +00:00
jband%netscape.com
0afa0bedfe NOT PART OF BUILD updating status page
git-svn-id: svn://10.0.0.236/trunk@49767 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:53:26 +00:00
dmose%mozilla.org
239d60872d update license boilerplate to NPL dual w/GPL, r=norris@netscape,a=norris@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49766 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:44:05 +00:00
kipp%netscape.com
74b117887f Found another type of symbol that indicates the presence of a static ctor
git-svn-id: svn://10.0.0.236/trunk@49765 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:39:48 +00:00
troy%netscape.com
eb8deb8c1b Removed unused data member
git-svn-id: svn://10.0.0.236/trunk@49764 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:32:07 +00:00
kipp%netscape.com
f0a6db6e3e r=ramiro; fix uninitialized refcnt bug that triggers an assertion when you're lucky
git-svn-id: svn://10.0.0.236/trunk@49763 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:31:55 +00:00
briano%netscape.com
1192ec6846 Automated update
git-svn-id: svn://10.0.0.236/trunk@49762 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:31:43 +00:00
alecf%netscape.com
d721125978 add detection for broken mmap()/write() behavior
contributed by jim_nance@yahoo.com
r=alecf


git-svn-id: svn://10.0.0.236/trunk@49761 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:29:09 +00:00
rogerl%netscape.com
4c19332cbb First cut at errors as exceptions - These changes should be benign since
the errors are being wrapped by runtime exceptions and still need to be
explicitly caught (this is happening in the interpreter, but not in
generated code).


git-svn-id: svn://10.0.0.236/trunk@49760 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:21:07 +00:00
waterson%netscape.com
4fa6ebaa6d Bug 15460. Expose XML element creation via nsIXMLElementFactory interface. r=kipp.
git-svn-id: svn://10.0.0.236/trunk@49759 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:12:21 +00:00
kipp%netscape.com
c9603305c7 r=dp; more leak tracking hooks added
git-svn-id: svn://10.0.0.236/trunk@49758 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:08:41 +00:00
waterson%netscape.com
9145c77cc4 Bug 15367. Dump 'class' instead of 'file/line' for NS_LOG_REFCNT. r=shaver,dp
git-svn-id: svn://10.0.0.236/trunk@49757 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:07:54 +00:00
kipp%netscape.com
eaaefb2093 r=dp; cleanup xpcom library too during shutdown to reduce global leaks
git-svn-id: svn://10.0.0.236/trunk@49756 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:07:39 +00:00
kipp%netscape.com
59997b00eb r=vidur; fixed a memory of a script content object
git-svn-id: svn://10.0.0.236/trunk@49755 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:05:38 +00:00
rhp%netscape.com
55b9838dc4 Fixes for bug #15363 and #14675 - reviewer bienvenu
git-svn-id: svn://10.0.0.236/trunk@49754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-05 00:03:20 +00:00
kipp%netscape.com
81d2477caa r=troy; missed checkin from last weeks module carpool
git-svn-id: svn://10.0.0.236/trunk@49753 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:56:57 +00:00
alecf%netscape.com
40b89da05b exorcism of net.h from IMAP
r=mscott


git-svn-id: svn://10.0.0.236/trunk@49752 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:53:56 +00:00
alecf%netscape.com
0ce90ca711 Combined checkin:
- convert Compose enums to IDL #13261
- exorcise net.h from compose and mime
r=ducarroz and rhp on both


git-svn-id: svn://10.0.0.236/trunk@49751 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:50:56 +00:00
nhotta%netscape.com
c34375d22a Bug fix 15017, reviewed by akkana. Override SetDocumentCharacterSet for HTMLEditor to update META charset tag if exists.
git-svn-id: svn://10.0.0.236/trunk@49750 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:50:27 +00:00
kipp%netscape.com
d2eaa239f7 r=ramiro; fixed memory leak of a font-metrics object; also added in ctor/dtor counting for leak debugging
git-svn-id: svn://10.0.0.236/trunk@49749 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:48:55 +00:00
troy%netscape.com
4f1bf46f5d Space optimization for nsTableFrame. r=karnaze@netscape.com
- changed mBorderEdges to be heap allocated (only needed for collapsing border model)
- made the 8 boolean data members into bitfields
- changed mColumnWidths to be as small as necessary instead of defaulting its size to 100 elements


git-svn-id: svn://10.0.0.236/trunk@49748 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:48:05 +00:00
troy%netscape.com
7eedfae1ee Made sure mOutsideEdge is initizlied
git-svn-id: svn://10.0.0.236/trunk@49747 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:44:44 +00:00
ducarroz%netscape.com
03b778a6f7 Fix for bug 14561, Already checked in the M10 BRANCH. Error must have negative value. A=choffman, R=mscott
git-svn-id: svn://10.0.0.236/trunk@49746 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:43:57 +00:00
troy%netscape.com
6311b52e3d Performance optimizations. r=kmcclusk@netscape.com
I made the commonly accessed stock objects global, and I optimized the
SetupSolidPen() code


git-svn-id: svn://10.0.0.236/trunk@49745 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:42:28 +00:00
kipp%netscape.com
a3570edb7f r=dp; tidy up exit logic to release more global junk (space team work)
git-svn-id: svn://10.0.0.236/trunk@49744 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:41:53 +00:00
kipp%netscape.com
9246660bae r=dp,vidur,beard; close up some memory leaks related to shutdown of the viewer
git-svn-id: svn://10.0.0.236/trunk@49743 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:41:25 +00:00
kipp%netscape.com
db15162105 r=dp; implement some macros to help track memory leaks
git-svn-id: svn://10.0.0.236/trunk@49742 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:36:18 +00:00
kipp%netscape.com
af9cdee1dc r=brendan; applied changes recommended by brendan
git-svn-id: svn://10.0.0.236/trunk@49741 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:35:51 +00:00
peterl%netscape.com
50c6f531fe fixed leak of undisplayed content map nodes (which leak style contexts)
r=kipp


git-svn-id: svn://10.0.0.236/trunk@49740 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:33:23 +00:00
valeski%netscape.com
3b535ab2ef NOT part of the build.
git-svn-id: svn://10.0.0.236/trunk@49739 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:13:11 +00:00
valeski%netscape.com
3e9e763bae NOT part of the build.
git-svn-id: svn://10.0.0.236/trunk@49738 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 23:12:02 +00:00
norris%netscape.com
288c2fdcfb Fix up makefiles; previous patch was mis-applied.
git-svn-id: svn://10.0.0.236/trunk@49733 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 21:31:21 +00:00
morse%netscape.com
66a3fad9de oops -- I carelessly left out a carriage return in my last checkin
git-svn-id: svn://10.0.0.236/trunk@49732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 21:07:01 +00:00
morse%netscape.com
6558fcffeb fix profile-manager bustage in todays build, checked in by request of leaf
git-svn-id: svn://10.0.0.236/trunk@49731 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 20:59:16 +00:00
kipp%netscape.com
ef2c286317 Fixed uninitialized members in the TreeNode struct
git-svn-id: svn://10.0.0.236/trunk@49729 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 20:25:53 +00:00
norris%netscape.com
19a71ea13f Fix bug found by Andrew Wason (see below).
Problem was that one transformation of a node to GETVAR wasn't protected by a check of inWithStatement().

======================================
Subject:
        multiple scopes
   Date:
        Fri, 01 Oct 1999 12:39:14 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




When I create two scopes, and one scope evaulates a string in the other
scope, it works.  However, if I do this while handling an exception thrown
within a JavaAdapter method, it fails with an exception.

Run the attached Java program with the two script files.  scope1.js
evaluates a string "printMessage" in the scope of scope2.js.  This returns
a function object which is then invoked.  This works in 3 cases, but fails
in the 4th (in the catch in the JavaAdapter).  Even in the 4th case where
it fails, printing the function object looks normal.

Am I doing something wrong, or is there a bug here?

java CrossScope scope1.js scope2.js

Outside of JavaAdapter
works before exception
works after exception
Inside of JavaAdapter
works before exception
Caught exception
pma=
function printMessage(msg) {
     java.lang.System.out.println(msg);
}

Exception in thread "main" org.mozilla.javascript.JavaScriptException:
org.mozilla.javascript.EvaluatorException: The undefined value has no
properties.
         at
org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException
.java:61)
         at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java,
Compiled Code)
         at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1256)
         at org.mozilla.javascript.Interpreter.interpret(Interpreter.java,
Compiled Code)
         at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:49)
         at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:37)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:697)
         at CrossScope.<init>(CrossScope.java:30)
         at CrossScope.main(CrossScope.java:10)


Thanks,
Andrew

import java.io.*;
import org.mozilla.javascript.*;

public class CrossScope {
	private Context m_jsContext;
	private Scriptable m_scope1;
	private Scriptable m_scope2;

	public static void main(String args[]) throws Exception {
		new CrossScope(args[0], args[1]);
	}

	private CrossScope(String strFile1, String strFile2) throws Exception {
		// Associate Context with main thread
		m_jsContext = Context.enter();
                m_jsContext.setOptimizationLevel(-1);

		// Init scope1, expose Scope object
  		m_scope1 = m_jsContext.initStandardObjects(new ImporterTopLevel());
		m_scope1.put("Scope", m_scope1, this);

		// Init scope2
		m_scope2 = m_jsContext.initStandardObjects(new ImporterTopLevel());

		// Run script in scope2
		Reader r2 = new FileReader(strFile2);
		m_jsContext.evaluateReader(m_scope2, r2, strFile2, 1, null);

		// Eval input JS in scope1 - it can in turn eval JS over in scope2
		Reader r1 = new FileReader(strFile1);
		Object obj = m_jsContext.evaluateReader(m_scope1, r1, strFile1, 1, null);
		if (obj instanceof Throwable)
			((Throwable)obj).printStackTrace();

		m_jsContext.exit();
	}

	public Object scope1Eval(String str) throws JavaScriptException {
			Context cx = Context.enter(m_jsContext);
			Object objResult = cx.evaluateString(m_scope1, str, "scope1EvalString", 1, null);
			cx.exit();
			return objResult;
	}

	public Object scope2Eval(String str) throws JavaScriptException {
			Context cx = Context.enter(m_jsContext);
			Object objResult = cx.evaluateString(m_scope2, str, "scope2EvalString", 1, null);
			cx.exit();
			return objResult;
	}
}


// Scope1

importPackage(java.lang);

System.out.println("Outside of JavaAdapter");

try {
	var pm = Scope.scope2Eval("printMessage");
	pm("works before exception");
	System.arraycopy(null, 5, null, 5, 100);
} catch (e) {
	var pma = Scope.scope2Eval("printMessage");
	pma("works after exception");
}

var obj = new Runnable() {
	run: function() {
		System.out.println("Inside of JavaAdapter");
		try {
			var pm = Scope.scope2Eval("printMessage");
			pm("works before exception");
			System.arraycopy(null, 5, null, 5, 100);
		} catch (e) {
			System.out.println("Caught exception");
			var pma = Scope.scope2Eval("printMessage");
			System.out.println("pma=" + pma);
			pma("works after exception");
		}
	}
};

obj.run();



// Scope2

function printMessage(msg) {
	java.lang.System.out.println(msg);
}


git-svn-id: svn://10.0.0.236/trunk@49726 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 18:27:30 +00:00
endico%mozilla.org
36e083362c make file searches case insentive
git-svn-id: svn://10.0.0.236/trunk@49725 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 18:11:27 +00:00
tao%netscape.com
d2b440e23a First checkin of da-DK files (from Henrik) into l10n/lang.
git-svn-id: svn://10.0.0.236/trunk@49724 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 18:01:19 +00:00
valeski%netscape.com
1c2b2f6390 adding keyword protocol handler to tree. this code is NOT in the build yet.
git-svn-id: svn://10.0.0.236/trunk@49722 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 16:34:45 +00:00
kipp%netscape.com
86725c9808 Added -R flag and logic for managing refcnt dumping better
git-svn-id: svn://10.0.0.236/trunk@49721 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 16:32:03 +00:00
neeti%netscape.com
0cb4e10e77 cookie module conversion done
git-svn-id: svn://10.0.0.236/trunk@49720 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 14:34:54 +00:00
neeti%netscape.com
1c9d47ade0 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@49719 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 14:08:52 +00:00
rods%netscape.com
ff1ff17b9d fixes bug #15265, changes reviewed by kmcclusk. Changes in the way it used the computed values
git-svn-id: svn://10.0.0.236/trunk@49718 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 13:49:00 +00:00
colin%theblakes.com
2eb916adb2 Don't link against xptinfo - its not needed. r=ramiro
git-svn-id: svn://10.0.0.236/trunk@49717 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 10:44:49 +00:00
colin%theblakes.com
41dd85d37f Make mkdepend lines shorter (OpenVMS only). r=ramiro
git-svn-id: svn://10.0.0.236/trunk@49716 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 10:43:28 +00:00
duncan%be.com
d0d0e41c47 Hack into compileable shape.
git-svn-id: svn://10.0.0.236/trunk@49715 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 08:52:17 +00:00
karnaze%netscape.com
c3e71c904f column allocation does fixed and adjusted fixed (colspans) in separate steps. Simplified AllocateConstrained. Fixed bug 14332.
git-svn-id: svn://10.0.0.236/trunk@49714 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 05:19:32 +00:00
ramiro%netscape.com
b6cc6b0ab0 Fix for xlib build bustage.
git-svn-id: svn://10.0.0.236/trunk@49713 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 04:49:45 +00:00
karnaze%netscape.com
399a1319c0 regression test changes
git-svn-id: svn://10.0.0.236/trunk@49712 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 04:48:13 +00:00
dp%netscape.com
77b37126c4 bug# 15433 Fixed call to NS_ADDREF() that would cause double
evaluation when MOZ_REFCNT is defined. Fixed checking for
OUT_OF_MEMORY condition. r=hyatt


git-svn-id: svn://10.0.0.236/trunk@49711 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 02:27:09 +00:00
leaf%mozilla.org
240237eba0 adding mozilla/gc/boehm to SeaMonkeyCore as per patrick beard's request
git-svn-id: svn://10.0.0.236/trunk@49710 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 01:17:58 +00:00
mscott%netscape.com
2e4127024c Bug #14680...migrating this bug from the M10 branch. make input and output stream for the converter pipe non-blocking.
r=ducarroz


git-svn-id: svn://10.0.0.236/trunk@49709 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 01:01:48 +00:00
mscott%netscape.com
322798e844 Bug #11837 --> rewrite the imap factory to use nsIModule. This meant adding appropriate factory methods to the components.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@49708 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 00:29:18 +00:00
mscott%netscape.com
94f2a23952 Bug #11837 --> rewrite the imap factory to use nsIModule.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@49707 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 00:27:42 +00:00
mscott%netscape.com
18a7fb8d42 Bug #15192 --> build the pab before the history ab for name completion.
r=bienvenu.


git-svn-id: svn://10.0.0.236/trunk@49706 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 00:26:10 +00:00
mscott%netscape.com
b36e29928a Bug #000...trivial fix so no bug # filed. Fix a leak of nsIURI by using nsCOMPtr.
r=bienvenu.


git-svn-id: svn://10.0.0.236/trunk@49705 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-04 00:25:12 +00:00
beard%netscape.com
9a1b140b6b First Checked In.
git-svn-id: svn://10.0.0.236/trunk@49702 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 23:28:33 +00:00
beard%netscape.com
90cd1e6284 File Removed.
git-svn-id: svn://10.0.0.236/trunk@49701 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 23:26:57 +00:00
beard%netscape.com
9f5a8b5090 breakage fixing, gc_stdout -> GC_stdout
git-svn-id: svn://10.0.0.236/trunk@49700 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 22:30:35 +00:00
sdagley%netscape.com
6c3f751156 changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=beard
git-svn-id: svn://10.0.0.236/trunk@49699 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 22:04:08 +00:00
sdagley%netscape.com
e9dac37427 using __NSTerminate() rather than __terminate, for GC leak detector. r=beard
git-svn-id: svn://10.0.0.236/trunk@49698 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 22:04:07 +00:00
beard%netscape.com
bc66d4807f removed pulling of mozilla/gc/boehm, no longer building NStdLibGC target. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49697 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 21:51:39 +00:00
beard%netscape.com
508a0c5b7d Added GC exports, so Stubs target will generate them.
git-svn-id: svn://10.0.0.236/trunk@49696 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 21:49:41 +00:00
beard%netscape.com
795fab8784 removed NSStdLibGC target, and .exp file. Moved exports to the one true NSStdLib.exp, so that Stubs target will see them. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49695 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 21:48:57 +00:00
beard%netscape.com
3ecbfc5cdf added more GC stub functions, so that NSStdLib can export them. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49694 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 21:47:11 +00:00
beard%netscape.com
f038869d64 fixed breakage, until mozilla/gc/boehm gets added to the default module.
git-svn-id: svn://10.0.0.236/trunk@49693 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 21:31:43 +00:00
beard%netscape.com
0c2f0d51f9 calling __NSInitialize/__NSTerminate to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49692 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:53:11 +00:00
beard%netscape.com
75c8c9cd12 changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49691 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:47:12 +00:00
beard%netscape.com
da97767078 changed from directly using "MSL DropInRuntime.Lib" to using "NSComponentStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49690 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:46:23 +00:00
beard%netscape.com
eaf44edde8 changed from directly using "MSL AppRuntime.Lib" to using "NSAppStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49689 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:43:01 +00:00
beard%netscape.com
ed2580f15a changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49688 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:37:53 +00:00
beard%netscape.com
cd941313ec changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49686 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:23:01 +00:00
beard%netscape.com
f25b9d367d changed from directly using "MSL DropInRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49685 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:13:50 +00:00
beard%netscape.com
da4024048d changed from directly using "MSL AppRuntime.Lib" to using "NSAppStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49684 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:11:44 +00:00
beard%netscape.com
a50c5f3df5 changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49683 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:08:40 +00:00
beard%netscape.com
4133a2fff5 added pulling of mozilla/gc/boehm, conditionally building gc.mcp if $GC_LEAK_DETECTOR is true, and building MemAllocator.mcp[MemAllocatorGC.o], NSStdLib.mcp[NSStdLibGC.shlb] if $GC_LEAK_DETECTOR is true. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49682 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:06:10 +00:00
beard%netscape.com
50068fd6e0 Added $GC_LEAK_DETECTOR. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49681 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:03:39 +00:00
beard%netscape.com
7835dfb07e added GC_LEAK_DETECTOR variable. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49680 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 20:01:48 +00:00
tonyr%fbdesigns.com
86f12df7f4 Update progID's from component://netscape/* to component://mozilla/*
git-svn-id: svn://10.0.0.236/trunk@49679 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 18:02:22 +00:00
tonyr%fbdesigns.com
9895a33add Fix bustage caused by new account manager API's
git-svn-id: svn://10.0.0.236/trunk@49678 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 18:00:23 +00:00
tonyr%fbdesigns.com
90b1f42534 Update to use nsIModule
git-svn-id: svn://10.0.0.236/trunk@49677 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 17:59:09 +00:00
tonyr%fbdesigns.com
0534ba836d Updated to use nsIModule
git-svn-id: svn://10.0.0.236/trunk@49676 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 17:55:56 +00:00
mcafee%netscape.com
1193314ab4 Better variable names for readability.
git-svn-id: svn://10.0.0.236/trunk@49675 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 08:13:41 +00:00
mcafee%netscape.com
3c1923f753 Adding text to debug pref UI documenting how the debugPaintFlashing pref works with the caps-lock key. r=braddr@portland.puremagic.com
git-svn-id: svn://10.0.0.236/trunk@49674 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 06:56:43 +00:00
beard%netscape.com
e5cdcb3d9a Modernized to use NSComponentStartup.o. Not part of build.
git-svn-id: svn://10.0.0.236/trunk@49673 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 02:58:48 +00:00
beard%netscape.com
1917b8abfe added access path to find Sample.idl. Not part of build.
git-svn-id: svn://10.0.0.236/trunk@49672 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 02:58:20 +00:00
hyatt%netscape.com
9060bb7e6c Fixing apprunner startup bustage on mac. r=beard
git-svn-id: svn://10.0.0.236/trunk@49671 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 01:41:06 +00:00
beard%netscape.com
ac349d4f71 Now that mozilla/lib/mac/NSStartup has been added to the modules file, SeaMonkeyEditor, reenabled building NSStartup.mcp. Converted building JSLoader.mcp into Components, per shaver's permission. r=smfr
git-svn-id: svn://10.0.0.236/trunk@49670 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 00:37:19 +00:00
leaf%mozilla.org
ef523b7bc1 adding mozilla/lib/mac/NSStartup
git-svn-id: svn://10.0.0.236/trunk@49669 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-03 00:12:49 +00:00
rjc%netscape.com
b928008ea2 Fix problem with nsSecurityManagerFactory conversion to be a nsIModule. Patch from peterl@netscape.com. Review: me.
git-svn-id: svn://10.0.0.236/trunk@49668 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 20:19:23 +00:00
peterl%netscape.com
8d9a25274c Don't access undisplayed content map if it isn't there...
git-svn-id: svn://10.0.0.236/trunk@49667 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 19:45:18 +00:00
rjc%netscape.com
dc26a2c638 Temporarily turning off the changes to nsSecurityManagerFactory to make it a nsIModule due to problem at startup.
git-svn-id: svn://10.0.0.236/trunk@49666 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 19:24:05 +00:00
morse%netscape.com
7eed8aaa95 add some new concatenation rules
git-svn-id: svn://10.0.0.236/trunk@49665 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 16:36:53 +00:00
rbs%maths.uq.edu.au
7f3f2e7069 Adding remaining MathML hooks. r:peterl.
git-svn-id: svn://10.0.0.236/trunk@49664 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 11:05:49 +00:00
rbs%maths.uq.edu.au
5022c51b04 Adding remaining MathML hooks
git-svn-id: svn://10.0.0.236/trunk@49663 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 11:01:41 +00:00
rbs%maths.uq.edu.au
1b6a18b9e4 Adding remaining MathML hooks and changing ifdef INCLUDE_MATHML to ifdef MOZ_MATHML to avoid thinking autoconf-related. r:peterl
git-svn-id: svn://10.0.0.236/trunk@49662 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 10:41:40 +00:00
rbs%maths.uq.edu.au
d3baf5491f Change of the IID for the nsIMathMLFrame interface. The previous IID was taken while the MathML code was awaiting to land.
git-svn-id: svn://10.0.0.236/trunk@49661 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 09:14:57 +00:00
rbs%maths.uq.edu.au
ef0e29ec51 Taking an interface ID for the nsIMathMLFrame interface
git-svn-id: svn://10.0.0.236/trunk@49660 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 09:00:39 +00:00
rbs%maths.uq.edu.au
142225cef1 Adding relative path to external DTD
git-svn-id: svn://10.0.0.236/trunk@49659 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 06:53:41 +00:00
rbs%maths.uq.edu.au
1a870b97f1 Initializing a variable to zero
git-svn-id: svn://10.0.0.236/trunk@49658 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 06:50:38 +00:00
rbs%maths.uq.edu.au
e1737fe531 Update to match recent changes in the nsIFrame API.
git-svn-id: svn://10.0.0.236/trunk@49657 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 06:20:30 +00:00
briano%netscape.com
712d5c7659 Added some tweaks and support for UnixWare 7.
git-svn-id: svn://10.0.0.236/trunk@49656 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 06:00:33 +00:00
peterl%netscape.com
b72d84c381 added hooks to track content that doesn't get a frame
Fix for bug 9013 (and any dynamic change from display:none) r=troy


git-svn-id: svn://10.0.0.236/trunk@49655 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:27:40 +00:00
peterl%netscape.com
5da81c87c7 Added ability to track changes to content without frame
Fix for bug 9013 (and any dynamic change from display:none) r=troy


git-svn-id: svn://10.0.0.236/trunk@49654 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:26:53 +00:00
peterl%netscape.com
f47d01c612 added API to track content that didn't get a frame
Fix for bug 9013 (and any dynamic change from display:none) r=troy


git-svn-id: svn://10.0.0.236/trunk@49653 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:26:24 +00:00
peterl%netscape.com
86ee025299 added multimap to track content that didn't get a frame
Fix for bug 9013 (and any dynamic change from display:none) r=troy


git-svn-id: svn://10.0.0.236/trunk@49652 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:25:29 +00:00
peterl%netscape.com
f6d5221996 removing dead style change code
r=troy


git-svn-id: svn://10.0.0.236/trunk@49651 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:24:20 +00:00
peterl%netscape.com
07e158b4cf removing dead style change code and refereneces to dead style change code
r=troy


git-svn-id: svn://10.0.0.236/trunk@49650 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:23:48 +00:00
peterl%netscape.com
39323d24e7 fixed fix to bug 15373. Now it won't crash on EOF conditions
git-svn-id: svn://10.0.0.236/trunk@49649 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 04:23:00 +00:00
scc%netscape.com
16b1141bdf Fixing Mac build bustage by backing out (actually commenting out) beards previous change. The project he cites isn't in the module (or something) and isn't getting checked out. Ergo, errors when you try to find it to build. Couldn't find anyone to review or approve and there is no bug number ... but it has to be done. I guess I'm going to hell.
git-svn-id: svn://10.0.0.236/trunk@49648 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 03:41:52 +00:00
norris%netscape.com
c3494a9ffb Fix the following bugs:
14443 "Same origin" security policy may be circumvented using docu
14820 Fixing up the relationship between nsCodeBasePrincipal and n
14919 Crash in JS MM code
Reviewed by mstoltz, approved by scc.


git-svn-id: svn://10.0.0.236/trunk@49647 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 03:41:37 +00:00
troy%netscape.com
bd5ca95ced Added SizeOf() handler for floater information maintained by the
line box


git-svn-id: svn://10.0.0.236/trunk@49644 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 02:51:03 +00:00
briano%netscape.com
612bb1db4c Added support for SCO UnixWare 7.
git-svn-id: svn://10.0.0.236/trunk@49643 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 02:49:32 +00:00
beard%netscape.com
e912c2233e added mozilla/lib/mac/NSStartup/NSStartup.mcp to the build. This will create NSAppStartup.o, NSComponentStartup.o, and NSLibraryStartup.o, and will permit conditional use of the GC leak detector. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@49642 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 02:21:17 +00:00
beard%netscape.com
200e34d9af First Checked In.
git-svn-id: svn://10.0.0.236/trunk@49640 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 01:52:41 +00:00
hyatt%netscape.com
ca4aac906f Resolving apprunner bustage in an unfortunate way. r=danm
git-svn-id: svn://10.0.0.236/trunk@49639 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 01:48:59 +00:00
peterl%netscape.com
3dfcb47c99 removed leak of atom
git-svn-id: svn://10.0.0.236/trunk@49638 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 01:32:38 +00:00
selmer%netscape.com
c571661492 Major rework on interpreting commands
git-svn-id: svn://10.0.0.236/trunk@49637 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 01:28:27 +00:00
hyatt%netscape.com
4efb5b42d5 Fixing the problem with chrome skin initialization in viewer and apprunner.
git-svn-id: svn://10.0.0.236/trunk@49634 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:55:57 +00:00
rjc%netscape.com
e2b731d7df Update leak docs. (Not part of build.)
git-svn-id: svn://10.0.0.236/trunk@49633 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:52:49 +00:00
troy%netscape.com
67890faf02 Added SizeOf() handler for space manager
git-svn-id: svn://10.0.0.236/trunk@49632 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:52:01 +00:00
rjc%netscape.com
741f87253e Bug # 14034: Convert to nsIModule to prepare for memory leak fixing. Review: dp@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49631 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:48:02 +00:00
gagan%netscape.com
ff2d0533a2 Fix for 14772. r-rjc/a-self. Removed the pragma no-cache header being sent to proxy requests.
git-svn-id: svn://10.0.0.236/trunk@49630 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:43:10 +00:00
av%netscape.com
8c170e98ee Fixing #13783 (garbage-pointer dereference)
git-svn-id: svn://10.0.0.236/trunk@49629 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:41:03 +00:00
kmcclusk%netscape.com
0a6c37218a r=rods;bug=14867 put in style rule to disable file selector button
bug=15328 put in disable rules for button label
bug=12227 To remove combobox reflows, changed padding settings for select's active
button to match non-active state. Also changed padding+border to match between
button's with focus and active buttons drawn with focus. Added gif for active state
of combo box to indicate that it is depressed.


git-svn-id: svn://10.0.0.236/trunk@49628 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:28:37 +00:00
frankm%eng.sun.com
7a48580674 To compile on Linux, renamed 'jarray' to 'theJarray' (jarray is a JNI type), and made sure all paths in xpjd_GetInterfaceInfoNative() return a jboolean (bug 15279).
Updated genproxy usage message, and moved printf within cmdline parsing code (bug 15386).
r=edburns@acm.org,akhil.arora@sun.com perm=scc


git-svn-id: svn://10.0.0.236/trunk@49626 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:18:02 +00:00
kmcclusk%netscape.com
e1b393609a r=rods; bug=15312 nsIWidget::GetParent now stops at the top of the widget hierarchy on WIN32
r=rods; bug=13644 Dropdown on WIN32 no longer causes parent window to change z-order or activation


git-svn-id: svn://10.0.0.236/trunk@49625 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:13:23 +00:00
tao%netscape.com
61705e7f39 makefile for lang.
git-svn-id: svn://10.0.0.236/trunk@49624 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:04:22 +00:00
briano%netscape.com
59b25d549c Automated update
git-svn-id: svn://10.0.0.236/trunk@49623 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:03:06 +00:00
troy%netscape.com
4e1923d3ad Hooked up SizeOf() for cell map and table layout strategies. Also added in
some table frame data that was missed


git-svn-id: svn://10.0.0.236/trunk@49622 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:02:54 +00:00
briano%netscape.com
42184097f4 Fix for HP-UX 11 problem trying to use libc_r when it shouldn't be.
git-svn-id: svn://10.0.0.236/trunk@49621 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 00:02:35 +00:00
valeski%netscape.com
285283e32e 15300 r=warren. Changed NS_NewThread api to default to PR_UNJOINABLE_THREAD, also added new NS_NewThread() function so you don't have to combine the runnable w/ thread creation. added threads to xpcom init so you can create them w/ the com mgr. 15298 r=gagan, FTP threads are now synched w/ ftp handler shutdown, removed extraneous buffer work, added ftp authentication, and ftp channel content length
git-svn-id: svn://10.0.0.236/trunk@49618 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 23:32:12 +00:00
valeski%netscape.com
780e7132fd 15300 r=warren. Changed NS_NewThread api to default to PR_UNJOINABLE_THREAD, also added new NS_NewThread() function so you don't have to combine the runnable w/ thread creation. added threads to xpcom init so you can create them w/ the com mgr.
git-svn-id: svn://10.0.0.236/trunk@49617 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 23:30:06 +00:00
dougt%netscape.com
1f12de6f96 adding hostname to socket provider. (r) warren.
git-svn-id: svn://10.0.0.236/trunk@49616 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 23:23:49 +00:00
briano%netscape.com
64c2d4fe86 Fix for AIX 4.2, specifically, but should help other platforms with shared library difficulties.
git-svn-id: svn://10.0.0.236/trunk@49614 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 23:07:38 +00:00
norris%netscape.com
69ec6c9b26 Contribution from Andrew Wason:
Subject:
        optimizer Makefiles
   Date:
        Fri, 01 Oct 1999 14:50:05 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




Norris,

Here are patches to the Rhino Makefiles to build the optimizer package and
the jsc compiler.  They also fix a problem with "gmake clean".

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com


git-svn-id: svn://10.0.0.236/trunk@49613 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 22:58:48 +00:00
norris%netscape.com
34f7a63ece \t doesn't work on Windows.
git-svn-id: svn://10.0.0.236/trunk@49612 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 22:56:30 +00:00
dp%netscape.com
aed86d7f55 Eliminating 3 leaks to servicemanager when running for the first time.
bug# 15387 r=law


git-svn-id: svn://10.0.0.236/trunk@49610 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 22:39:20 +00:00
dbragg%netscape.com
e42eb9313a Initial checkin of mac xpi build files. Approval=trudelle, Reviewer=ssu
git-svn-id: svn://10.0.0.236/trunk@49609 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 22:31:46 +00:00
hyatt%netscape.com
ac3d91fcff Restructuring ua.css.
git-svn-id: svn://10.0.0.236/trunk@49608 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:57:32 +00:00
hyatt%netscape.com
ade56298bb Restructuring ua.css to use html.css
git-svn-id: svn://10.0.0.236/trunk@49607 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:57:01 +00:00
Jerry.Kirk%Nexwarecorp.com
26bb29ed10 Photon Only...
Added ConsumeEvents parameter to CaptureRollupEvents
r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@49606 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:54:47 +00:00
tao%netscape.com
a981cb2868 Add new makefile to hook up lang/ directory.
git-svn-id: svn://10.0.0.236/trunk@49605 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:54:30 +00:00
hyatt%netscape.com
2c843652fd Fixing bustage.
git-svn-id: svn://10.0.0.236/trunk@49604 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:47:17 +00:00
pierre%netscape.com
bf6316462c Fixed #14416 "GFX combo boxes cause zombie windows": there was a memory leak in WidgetToScreen and ScreenToWidget. r=dcone/sfraser
Fixed #14775 "Crash removing delete observer when closing windows": reshuffled nsToolkit and added nsMacFocusHandler to nsMacEventHandler. r=dcone/sfraser


git-svn-id: svn://10.0.0.236/trunk@49603 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:40:22 +00:00
pierre%netscape.com
a8c2a315be Fixed #14775 "Crash removing delete observer when closing windows": reshuffled nsToolkit and added nsMacFocusHandler to nsMacEventHandler. r=dcone/sfraser
git-svn-id: svn://10.0.0.236/trunk@49602 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:40:04 +00:00
fur%netscape.com
da2095c0dc Updated API
git-svn-id: svn://10.0.0.236/trunk@49601 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:30:53 +00:00
briano%netscape.com
2f25a96f14 Fixed the typo that broke the Unix builds.
git-svn-id: svn://10.0.0.236/trunk@49600 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:19:14 +00:00
Jerry.Kirk%Nexwarecorp.com
24cefa52e6 Photon Only changes...
remove bogus call to nsIAppShell->GetNativeData since it isn't used
Added code for menu RollUp
Change Invalidate Code  not to when widget is not Realized
Changed mUpdateArea from nsRect to nsIRegion
Moved the HandleEvent code from nsWindow to nsWidget
r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@49599 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:06:43 +00:00
hyatt%netscape.com
deebca4e10 Adding skin.css
git-svn-id: svn://10.0.0.236/trunk@49598 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 21:01:24 +00:00
akkana%netscape.com
163649cbd0 Automated tests of output. Not part of apprunner, not built by default.
Fix Compare() function;
add lots of before and after files for testing various regressions;
add a TestOutSinks script which tests the known cases.


git-svn-id: svn://10.0.0.236/trunk@49596 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:55:01 +00:00
hyatt%netscape.com
04637210d9 Splitting xul.css into two files and making them load automatically at startup. R=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@49595 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:49:07 +00:00
danm%netscape.com
2e268f54e5 making copacetic for AIX
git-svn-id: svn://10.0.0.236/trunk@49593 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:27:45 +00:00
valeski%netscape.com
7c54ad976a 15296 r=gagan. Added .txt extension to the MIME type extension resolver.
git-svn-id: svn://10.0.0.236/trunk@49592 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:25:38 +00:00
pavlov%netscape.com
4d36473556 remove files since we have idl files for both of these r=pinkerton
git-svn-id: svn://10.0.0.236/trunk@49591 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:16:36 +00:00
dp%netscape.com
bb72e03927 Using NS_ENSURE and NS_GET_IID()
git-svn-id: svn://10.0.0.236/trunk@49590 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:13:55 +00:00
kipp%netscape.com
90f49df885 r=peterl; bug=15373; Fixed atom memory leaky
git-svn-id: svn://10.0.0.236/trunk@49589 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:13:39 +00:00
av%netscape.com
f6b2303084 Fixing dereferencing null-pointer. Caused crash, #14496
git-svn-id: svn://10.0.0.236/trunk@49588 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:10:39 +00:00
dp%netscape.com
055feb1f4f Converter to nsIModule to prepare for memory leaks fixing.
Bug# 14034 r=waterson


git-svn-id: svn://10.0.0.236/trunk@49587 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 20:04:34 +00:00
kin%netscape.com
2471a39269 Fix VC5 build bustage with (T*) cast.
git-svn-id: svn://10.0.0.236/trunk@49583 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 16:23:17 +00:00
danm%netscape.com
f8f515a025 event handler holds weak reference to frame. fixes bug 14885. r:buster
git-svn-id: svn://10.0.0.236/trunk@49582 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 15:04:15 +00:00
dcone%netscape.com
1cfea69ffd added background fix.. commented out for now until other platforms are tested
git-svn-id: svn://10.0.0.236/trunk@49581 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:35:20 +00:00
rods%netscape.com
8da5559e0f Added new method to tell the listcontrolframe it is about to be rolled up by the combobox
this enables it to unset any temporary selections and restore the actual selection


git-svn-id: svn://10.0.0.236/trunk@49580 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:30:33 +00:00
rods%netscape.com
f6ec8c8015 ifdef'd out the new code that handles the computed size and ifdef'ed in the old code for Linux
git-svn-id: svn://10.0.0.236/trunk@49579 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:28:25 +00:00
rods%netscape.com
f896ef768d ifdef out a debug statement
git-svn-id: svn://10.0.0.236/trunk@49578 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:26:40 +00:00
rods%netscape.com
457fc28670 removed noisy printf
git-svn-id: svn://10.0.0.236/trunk@49577 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:20:45 +00:00
troy%netscape.com
3dc6e05d82 Optimized rendering context setup and solid brush handling
git-svn-id: svn://10.0.0.236/trunk@49576 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:19:36 +00:00
valeski%netscape.com
830f8c1257 15352 r=jevering. regular pointers to com ptrs changeover, as well as more initialization of a PRExplodedTime struct.
git-svn-id: svn://10.0.0.236/trunk@49575 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 14:10:02 +00:00
valeski%netscape.com
31bda0647d 12748 r=Andreas. Completely removed the GetHostByAddr() call so we no longer do any reverse lookups
git-svn-id: svn://10.0.0.236/trunk@49574 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 13:38:46 +00:00
valeski%netscape.com
7c49c9f9ea 15297 r=gagan. Condensed Enumerate() Reset() call combinations to overloaded Reset()
git-svn-id: svn://10.0.0.236/trunk@49573 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 13:37:11 +00:00
kin%netscape.com
698d1ed095 Fix for bug #12195: [DOGFOOD] caret cruft left after a backspace at end of line
Added code to DrawCaretWithContext() that makes sure that the caret
doesn't hang outiside the left edge of a frame.
r=sfraser@netscape.com


git-svn-id: svn://10.0.0.236/trunk@49572 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 13:16:30 +00:00
ramiro%netscape.com
6ee88bb33f fix build bustage.
git-svn-id: svn://10.0.0.236/trunk@49567 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-01 12:21:33 +00:00
840 changed files with 54130 additions and 142209 deletions

View File

@@ -0,0 +1,617 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -0,0 +1,617 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -0,0 +1,717 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******************************************************************************************
MODULE NOTES:
This file contains the nsStr data structure.
This general purpose buffer management class is used as the basis for our strings.
It's benefits include:
1. An efficient set of library style functions for manipulating nsStrs
2. Support for 1 and 2 byte character strings (which can easily be increased to n)
3. Unicode awareness and interoperability.
*******************************************************************************************/
#include "nsStr.h"
#include "bufferRoutines.h"
#include "stdio.h" //only used for printf
#include "nsCRT.h"
#include "nsDeque.h"
//static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1.";
//static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1.";
static const PRUnichar gCommonEmptyBuffer[1] = {0};
/**
* This method initializes all the members of the nsStr structure
*
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,eCharSize aCharSize) {
aDest.mStr=(char*)gCommonEmptyBuffer;
aDest.mLength=0;
aDest.mCapacity=0;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=0;
}
/**
* This method initializes all the members of the nsStr structure
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer){
aDest.mStr=(aCString) ? aCString : (char*)gCommonEmptyBuffer;
aDest.mLength=aLength;
aDest.mCapacity=aCapacity;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=aOwnsBuffer;
}
/**
* This member destroys the memory buffer owned by an nsStr object (if it actually owns it)
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Destroy(nsStr& aDest) {
if((aDest.mStr) && (aDest.mStr!=(char*)gCommonEmptyBuffer)) {
Free(aDest);
}
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents are not preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::EnsureCapacity(nsStr& aString,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aString.mCapacity) {
result=Realloc(aString,aNewLength);
if(aString.mStr)
AddNullTerminator(aString);
}
return result;
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents ARE preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::GrowCapacity(nsStr& aDest,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
result=EnsureCapacity(theTempStr,aNewLength);
if(result) {
if(aDest.mLength) {
Append(theTempStr,aDest,0,aDest.mLength);
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mLength=theTempStr.mLength;
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
return result;
}
/**
* Replaces the contents of aDest with aSource, up to aCount of chars.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed.
* @param aSource is where chars are copied from
* @param aCount is the number of chars copied from aSource
*/
void nsStr::Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(&aDest!=&aSource){
Truncate(aDest,0);
Append(aDest,aSource,anOffset,aCount);
}
}
/**
* This method appends the given nsStr to this one. Note that we have to
* pay attention to the underlying char-size of both structs.
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aSource is where char are copied from
* @aCount is the number of bytes to be copied
*/
void nsStr::Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(anOffset<aSource.mLength){
PRUint32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRUint32 theLength=(anOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-anOffset);
if(0<theLength){
PRBool isBigEnough=PR_TRUE;
if(aDest.mLength+theLength > aDest.mCapacity) {
isBigEnough=GrowCapacity(aDest,aDest.mLength+theLength);
}
if(isBigEnough) {
//now append new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDest.mLength,aSource.mStr,anOffset,theLength);
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}
}
}
}
/**
* This method inserts up to "aCount" chars from a source nsStr into a dest nsStr.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed
* @param aDestOffset is where in aDest the insertion is to occur
* @param aSource is where chars are copied from
* @param aSrcOffset is where in aSource chars are copied from
* @param aCount is the number of chars from aSource to be inserted into aDest
*/
void nsStr::Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount){
//there are a few cases for insert:
// 1. You're inserting chars into an empty string (assign)
// 2. You're inserting onto the end of a string (append)
// 3. You're inserting onto the 1..n-1 pos of a string (the hard case).
if(0<aSource.mLength){
if(aDest.mLength){
if(aDestOffset<aDest.mLength){
PRInt32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRInt32 theLength=(aSrcOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-aSrcOffset);
if(aSrcOffset<aSource.mLength) {
//here's the only new case we have to handle.
//chars are really being inserted into our buffer...
if(aDest.mLength+theLength > aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
PRBool isBigEnough=EnsureCapacity(theTempStr,aDest.mLength+theLength); //grow the temp buffer to the right size
if(isBigEnough) {
if(aDestOffset) {
Append(theTempStr,aDest,0,aDestOffset); //first copy leftmost data...
}
Append(theTempStr,aSource,0,aSource.mLength); //next copy inserted (new) data
PRUint32 theRemains=aDest.mLength-aDestOffset;
if(theRemains) {
Append(theTempStr,aDest,aDestOffset,theRemains); //next copy rightmost data
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
else {
//shift the chars right by theDelta...
(*gShiftChars[aDest.mCharSize][KSHIFTRIGHT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
//now insert new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDestOffset,aSource.mStr,aSrcOffset,theLength);
}
//finally, make sure to update the string length...
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}//if
//else nothing to do!
}
else Append(aDest,aSource,0,aCount);
}
else Append(aDest,aSource,0,aCount);
}
}
/**
* This method deletes up to aCount chars from aDest
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aDestOffset is where in aDest deletion is to occur
* @param aCount is the number of chars to be deleted in aDest
*/
void nsStr::Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount){
if(aDestOffset<aDest.mLength){
PRUint32 theDelta=aDest.mLength-aDestOffset;
PRUint32 theLength=(theDelta<aCount) ? theDelta : aCount;
if(aDestOffset+theLength<aDest.mLength) {
//if you're here, it means we're cutting chars out of the middle of the string...
//so shift the chars left by theLength...
(*gShiftChars[aDest.mCharSize][KSHIFTLEFT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
aDest.mLength-=theLength;
AddNullTerminator(aDest);
}
else Truncate(aDest,aDestOffset);
}//if
}
/**
* This method truncates the given nsStr at given offset
* @update gess10/30/98
* @param aDest is the nsStr to be truncated
* @param aDestOffset is where in aDest truncation is to occur
*/
void nsStr::Truncate(nsStr& aDest,PRUint32 aDestOffset){
if(aDestOffset<aDest.mLength){
aDest.mLength=aDestOffset;
AddNullTerminator(aDest);
}
}
/**
* This method forces the given string to upper or lowercase
* @update gess1/7/99
* @param aDest is the string you're going to change
* @param aToUpper: if TRUE, then we go uppercase, otherwise we go lowercase
* @return
*/
void nsStr::ChangeCase(nsStr& aDest,PRBool aToUpper) {
// somehow UnicharUtil return failed, fallback to the old ascii only code
gCaseConverters[aDest.mCharSize](aDest.mStr,aDest.mLength,aToUpper);
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
if((aDest.mLength>0) && aSet){
PRInt32 theIndex=-1;
PRInt32 theMax=aDest.mLength;
PRInt32 theSetLen=nsCRT::strlen(aSet);
if(aEliminateLeading) {
while(++theIndex<=theMax) {
PRUnichar theChar=GetCharAt(aDest,theIndex);
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound==thePos)
break;
}
if(0<theIndex) {
if(theIndex<theMax) {
Delete(aDest,0,theIndex);
}
else Truncate(aDest,0);
}
}
if(aEliminateTrailing) {
theIndex=aDest.mLength;
PRInt32 theNewLen=theIndex;
while(--theIndex>0) {
PRUnichar theChar=GetCharAt(aDest,theIndex); //read at end now...
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound<thePos)
theNewLen=theIndex;
else break;
}
if(theNewLen<theMax) {
Truncate(aDest,theNewLen);
}
}
}
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
Trim(aDest,aSet,aEliminateLeading,aEliminateTrailing);
PRUint32 aNewLen=gCompressChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::StripChars(nsStr& aDest,const char* aSet){
if((0<aDest.mLength) && (aSet)) {
PRUint32 aNewLen=gStripChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
}
/**************************************************************
Searching methods...
**************************************************************/
/**
* This searches aDest for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
// NS_PRECONDITION(aTarget.mLength!=1,kCallFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 theMax=aDest.mLength-aTarget.mLength;
PRInt32 index=(0<=anOffset) ? anOffset : 0;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
PRInt32 theTargetMax=aTarget.mLength;
while(index<=theMax) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aTarget,theSubIndex)) : GetCharAt(aTarget,theSubIndex);
matches=PRBool(theChar==theTargetChar);
}
if(matches) {
result=index;
break;
}
index++;
} //while
}//if
}//if
return result;
}
/**
* This searches aDest for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? (PRUint32)anOffset : 0;
result=gFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallFindChar);
PRInt32 index=(0<=anOffset) ? anOffset-1 : -1;
PRInt32 thePos;
//Note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if((0<aDest.mLength) && (0<aSet.mLength)){
while(++index<(PRInt32)aDest.mLength) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**************************************************************
Reverse Searching methods...
**************************************************************/
/**
* This searches aDest (in reverse) for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search (counting from left)
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aTarget.mLength!=1,kCallRFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
nsStr theCopy;
nsStr::Initialize(theCopy,eOneByte);
nsStr::Assign(theCopy,aTarget,0,aTarget.mLength);
if(aIgnoreCase){
nsStr::ChangeCase(theCopy,PR_FALSE); //force to lowercase
}
PRInt32 theTargetMax=theCopy.mLength;
while(index>=0) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_FALSE;
if(index+theCopy.mLength<=aDest.mLength) {
matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theDestChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=GetCharAt(theCopy,theSubIndex);
matches=PRBool(theDestChar==theTargetChar);
} //while
} //if
if(matches) {
result=index;
break;
}
index--;
} //while
nsStr::Destroy(theCopy);
}//if
}//if
return result;
}
/**
* This searches aDest (in reverse) for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
result=gRFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest (in reverese) for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallRFindChar);
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength;
PRInt32 thePos;
//note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if(0<aDest.mLength) {
while(--index>=0) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**
* Compare source and dest strings, up to an (optional max) number of chars
* @param aDest is the first str to compare
* @param aSource is the second str to compare
* @param aCount -- if (-1), then we use length of longer string; if (0<aCount) then it gives the max # of chars to compare
* @param aIgnorecase tells us whether to search with case sensitivity
* @return aDest<aSource=-1;aDest==aSource==0;aDest>aSource=1
*/
PRInt32 nsStr::Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase) {
PRInt32 result=0;
if(aCount) {
PRInt32 minlen=(aSource.mLength<aDest.mLength) ? aSource.mLength : aDest.mLength;
if(0==minlen) {
if ((aDest.mLength == 0) && (aSource.mLength == 0))
return 0;
if (aDest.mLength == 0)
return -1;
return 1;
}
PRInt32 maxlen=(aSource.mLength<aDest.mLength) ? aDest.mLength : aSource.mLength;
aCount = (aCount<0) ? maxlen : MinInt(aCount,maxlen);
result=(*gCompare[aDest.mCharSize][aSource.mCharSize])(aDest.mStr,aSource.mStr,aCount,aIgnoreCase);
}
return result;
}
//----------------------------------------------------------------------------------------
PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) {
static int mAllocCount=0;
mAllocCount++;
//we're given the acount value in charunits; now scale up to next multiple.
PRUint32 theNewCapacity=kDefaultStringSize;
while(theNewCapacity<aCount){
theNewCapacity<<=1;
}
aDest.mCapacity=theNewCapacity++;
PRUint32 theSize=(theNewCapacity<<aDest.mCharSize);
aDest.mStr = (char*)nsAllocator::Alloc(theSize);
PRBool result=PR_FALSE;
if(aDest.mStr) {
aDest.mOwnsBuffer=1;
result=PR_TRUE;
}
return result;
}
PRBool nsStr::Free(nsStr& aDest){
if(aDest.mStr){
if(aDest.mOwnsBuffer){
nsAllocator::Free(aDest.mStr);
}
aDest.mStr=0;
aDest.mOwnsBuffer=0;
return PR_TRUE;
}
return PR_FALSE;
}
PRBool nsStr::Realloc(nsStr& aDest,PRUint32 aCount){
nsStr temp;
memcpy(&temp,&aDest,sizeof(aDest));
PRBool result=Alloc(temp,aCount);
if(result) {
Free(aDest);
aDest.mStr=temp.mStr;
aDest.mCapacity=temp.mCapacity;
aDest.mOwnsBuffer=temp.mOwnsBuffer;
}
return result;
}
//----------------------------------------------------------------------------------------
CBufDescriptor::CBufDescriptor(char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_FALSE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_TRUE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_FALSE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_TRUE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
//----------------------------------------------------------------------------------------

View File

@@ -0,0 +1,450 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
1. There are two philosophies to building string classes:
A. Hide the underlying buffer & offer API's allow indirect iteration
B. Reveal underlying buffer, risk corruption, but gain performance
We chose the option B for performance reasons.
2 Our internal buffer always holds capacity+1 bytes.
The nsStr struct is a simple structure (no methods) that contains
the necessary info to be described as a string. This simple struct
is manipulated by the static methods provided in this class.
(Which effectively makes this a library that works on structs).
There are also object-based versions called nsString and nsAutoString
which use nsStr but makes it look at feel like an object.
***********************************************************************/
/***********************************************************************
ASSUMPTIONS:
1. nsStrings and nsAutoString are always null terminated.
2. If you try to set a null char (via SetChar()) a new length is set
3. nsCStrings can be upsampled into nsString without data loss
4. Char searching is faster than string searching. Use char interfaces
if your needs will allow it.
5. It's easy to use the stack for nsAutostring buffer storage (fast too!).
See the CBufDescriptor class in this file.
6. It's ONLY ok to provide non-null-terminated buffers to Append() and Insert()
provided you specify a 0<n value for the optional count argument.
7. Downsampling from nsString to nsCString is lossy -- avoid it if possible!
8. Calls to ToNewCString() and ToNewUnicode() should be matched with calls to Recycle().
***********************************************************************/
/**********************************************************************************
AND NOW FOR SOME GENERAL DOCUMENTATION ON STRING USAGE...
The fundamental datatype in the string library is nsStr. It's a structure that
provides the buffer storage and meta-info. It also provides a C-style library
of functions for direct manipulation (for those of you who prefer K&R to Bjarne).
Here's a diagram of the class hierarchy:
nsStr
|___nsString
| |
| ------nsAutoString
|
|___nsCString
|
------nsCAutoString
Why so many string classes? The 4 variants give you the control you need to
determine the best class for your purpose. There are 2 dimensions to this
flexibility: 1) stack vs. heap; and 2) 1-byte chars vs. 2-byte chars.
Note: While nsAutoString and nsCAutoString begin life using stack-based storage,
they may not stay that way. Like all nsString classes, autostrings will
automatically grow to contain the data you provide. When autostrings
grow beyond their intrinsic buffer, they switch to heap based allocations.
(We avoid alloca to avoid considerable platform difficulties; see the
GNU documentation for more details).
I should also briefly mention that all the string classes use a "memory agent"
object to perform memory operations. This class proxies the standard nsAllocator
for actual memory calls, but knows the structure of nsStr making heap operations
more localized.
CHOOSING A STRING CLASS:
In order to choose a string class for you purpose, use this handy table:
heap-based stack-based
-----------------------------------
ascii data | nsCString nsCAutoString |
|----------------------------------
unicode data | nsString nsAutoString |
-----------------------------------
Note: The i18n folks will stenuously object if we get too carried away with the
use of nsCString's that pass interface boundaries. Try to limit your
use of these to external interfaces that demand them, or for your own
private purposes in cases where they'll never be seen by humans.
PERFORMANCE CONSIDERATIONS:
Here are a few tricks to know in order to get better string performance:
1) Try to limit conversions between ascii and unicode; By sticking with nsString
wherever possible your code will be i18n-compliant.
2) Preallocating your string buffer cuts down trips to the allocator. So if you
have need for an arbitrarily large buffer, pre-size it like this:
{
nsString mBuffer;
mBuffer.SetCapacity(aReasonableSize);
}
3) Allocating nsAutoString or nsCAutoString on the heap is memory inefficient
(after all, the whole point is to avoid a heap allocation of the buffer).
4) Consider using an autoString to write into your arbitrarily-sized stack buffers, rather
than it's own buffers.
For example, let's say you're going to call printf() to emit pretty-printed debug output
of your object. You know from experience that the pretty-printed version of your object
exceeds the capacity of an autostring. Ignoring memory considerations, you could simply
use nsCString, appending the stringized version of each of your class's data members.
This will probably result in calls to the heap manager.
But there's a way to do this without necessarily having to call the heap manager.
All you do is declare a stack based buffer and instruct nsCString to use that instead
of it's own internal buffer by using the CBufDescriptor class:
{
char theBuffer[256];
CBufDescritor theBufDecriptor( theBuffer, PR_TRUE, sizeof(theBuffer), 0);
nsCAutoString s3( theBufDescriptor );
s3="HELLO, my name is inigo montoya, you killed my father, prepare to die!.";
}
The assignment statment to s3 will cause the given string to be written to your
stack-based buffer via the normal nsString/nsCString interfaces. Cool, huh?
Note however that just like any other nsStringXXX use, if you write more data
than will fit in the buffer, a visit to the heap manager will be in order.
**********************************************************************************/
#ifndef _nsStr
#define _nsStr
#include "nscore.h"
#include "nsIAllocator.h"
#include <string.h>
//----------------------------------------------------------------------------------------
enum eCharSize {eOneByte=0,eTwoByte=1};
#define kDefaultCharSize eTwoByte
#define kRadix10 (10)
#define kRadix16 (16)
#define kAutoDetect (100)
#define kRadixUnknown (kAutoDetect+1)
const PRInt32 kDefaultStringSize = 64;
const PRInt32 kNotFound = -1;
//----------------------------------------------------------------------------------------
class NS_COM CBufDescriptor {
public:
CBufDescriptor(char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(PRUnichar* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
char* mBuffer;
eCharSize mCharSize;
PRUint32 mCapacity;
PRInt32 mLength;
PRBool mStackBased;
PRBool mIsConst;
};
//----------------------------------------------------------------------------------------
struct NS_COM nsStr {
//----------------------------------------------------------------------------------------
nsStr() {
MOZ_COUNT_CTOR(nsStr);
}
~nsStr() {
MOZ_COUNT_DTOR(nsStr);
}
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,eCharSize aCharSize);
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer);
/**
* This method destroys the given nsStr, and *MAY*
* deallocate it's memory depending on the setting
* of the internal mOwnsBUffer flag.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used to the nsStr
*/
static void Destroy(nsStr& aDest);
/**
* These methods are where memory allocation/reallocation occur.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used on the nsStr
* @return
*/
static PRBool EnsureCapacity(nsStr& aString,PRUint32 aNewLength);
static PRBool GrowCapacity(nsStr& aString,PRUint32 aNewLength);
/**
* These methods are used to append content to the given nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to assign contents of a source string to dest string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to insert content from source string to the dest nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to insert
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount);
/**
* This method deletes chars from the given str.
* The given allocator may choose to resize the str as well.
*
* @update gess 01/04/99
* @param aDest is the nsStr to be deleted from
* @param aDestOffset tells us where in dest to start deleting
* @param aCount tells us the (max) # of chars to delete
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount);
/**
* This method is used to truncate the given string.
* The given allocator may choose to resize the str as well (but it's not likely).
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Truncate(nsStr& aDest,PRUint32 aDestOffset);
/**
* This method is used to perform a case conversion on the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be case shifted
* @param toUpper tells us to go upper vs. lower
*/
static void ChangeCase(nsStr& aDest,PRBool aToUpper);
/**
* This method trims chars (given in aSet) from the edges of given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to remove from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method compresses duplicate runs of a given char from the given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method removes all occurances of chars in given set from aDest
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void StripChars(nsStr& aDest,const char* aSet);
/**
* This method compares the data bewteen two nsStr's
*
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
static PRInt32 Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase);
/**
* These methods scan the given string for 1 or more chars in a given direction
*
* @update gess 01/04/99
* @param aDest is the nsStr to be searched to
* @param aSource (or aChar) is the substr we're looking to find
* @param aIgnoreCase tells us whether to search in a case-sensitive manner
* @param anOffset tells us where in the dest string to start searching
* @return the index of the source (substr) in dest, or -1 (kNotFound) if not found.
*/
static PRInt32 FindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
PRUint32 mLength;
PRUint32 mCapacity;
eCharSize mCharSize;
PRBool mOwnsBuffer;
union {
char* mStr;
PRUnichar* mUStr;
};
private:
static PRBool Alloc(nsStr& aString,PRUint32 aCount);
static PRBool Realloc(nsStr& aString,PRUint32 aCount);
static PRBool Free(nsStr& aString);
};
/**************************************************************
A couple of tiny helper methods used in the string classes.
**************************************************************/
inline PRInt32 MinInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt1 : anInt2;
}
inline PRInt32 MaxInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt2 : anInt1;
}
inline void AddNullTerminator(nsStr& aDest) {
if(eTwoByte==aDest.mCharSize)
aDest.mUStr[aDest.mLength]=0;
else aDest.mStr[aDest.mLength]=0;
}
/**
* Return the given buffer to the heap manager. Calls allocator::Free()
* @return string length
*/
inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); }
inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); }
/**
* This method is used to access a given char in the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param anIndex tells us where in dest to get the char from
* @return the given char, or 0 if anIndex is out of range
*/
inline PRUnichar GetCharAt(const nsStr& aDest,PRUint32 anIndex){
if(anIndex<aDest.mLength) {
return (eTwoByte==aDest.mCharSize) ? aDest.mUStr[anIndex] : aDest.mStr[anIndex];
}//if
return 0;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,747 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsCString_
#define _nsCString_
#include "nsString2.h"
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsStr.h"
#include "nsIAtom.h"
class NS_COM nsSubsumeCStr;
class NS_COM nsCString : public nsStr {
public:
/**
* Default constructor.
*/
nsCString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsCString(const char* aCString,PRInt32 aLength=-1);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsCString(const PRUnichar* aString,PRInt32 aLength=-1);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsCString
*/
nsCString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsCString
*/
nsCString(const nsCString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsCString(nsSubsumeCStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsCString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string capacity
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Accessor methods...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String creation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new string
*/
nsSubsumeCStr operator+(const nsCString& aString);
/**
* create a new string by adding this to the given char*.
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(const char* aCString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(PRUnichar aChar);
nsSubsumeCStr operator+(char aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsCString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsCString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsCString& StripChars(const char* aSet);
nsCString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsCString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsCString& ReplaceChar(PRUnichar aOldChar,PRUnichar aNewChar);
nsCString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsCString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
operator char*() {return mStr;}
operator const char*() const {return (const char*)mStr;}
/**
* This method constructs a new nsCString that is a clone
* of this string.
*
*/
nsCString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsCString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsCString& SetString(const nsStr& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsCString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Assign(const char* aString,PRInt32 aCount=-1);
nsCString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsCString& Assign(PRUnichar aChar);
nsCString& Assign(char aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(char aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString,PRInt32 aCount);
nsCString& Append(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Append(const char* aString,PRInt32 aCount=-1);
nsCString& Append(PRUnichar aChar);
nsCString& Append(char aChar);
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsCString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsCString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsCString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsCString& Insert(const nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(PRUnichar aChar,PRUint32 anOffset);
nsCString& Insert(char aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsCString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char* aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars in given string you want to compare
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const nsStr& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const PRUnichar* aString,PRInt32 aCount=-1) const;
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
};
extern NS_COM int fputs(const nsCString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsCString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsCAutoString : public nsCString {
public:
nsCAutoString();
nsCAutoString(const char* aString,PRInt32 aLength=-1);
nsCAutoString(const CBufDescriptor& aBuffer);
nsCAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsCAutoString(const nsStr& aString);
nsCAutoString(const nsCAutoString& aString);
#ifdef AIX
nsCAutoString(const nsSubsumeCStr& aSubsumeStr); // AIX requires a const
#else
nsCAutoString(nsSubsumeCStr& aSubsumeStr);
#endif // AIX
nsCAutoString(PRUnichar aChar);
virtual ~nsCAutoString();
nsCAutoString& operator=(const nsCString& aString) {nsCString::Assign(aString); return *this;}
nsCAutoString& operator=(const char* aCString) {nsCString::Assign(aCString); return *this;}
nsCAutoString& operator=(PRUnichar aChar) {nsCString::Assign(aChar); return *this;}
nsCAutoString& operator=(char aChar) {nsCString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeCStr : public nsCString {
public:
nsSubsumeCStr(nsStr& aString);
nsSubsumeCStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeCStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,840 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsString_
#define _nsString_
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsString.h"
#include "nsIAtom.h"
#include "nsStr.h"
#include "nsCRT.h"
class nsISizeOfHandler;
#define nsString2 nsString
#define nsAutoString2 nsAutoString
class NS_COM nsSubsumeStr;
class NS_COM nsString : public nsStr {
public:
/**
* Default constructor.
*/
nsString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsString(const char* aCString);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsString(const PRUnichar* aString);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsString
*/
nsString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsString
*/
nsString(const nsString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsString(nsSubsumeStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string length
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
*
* @return TRUE if ordered.
*/
PRBool IsUnicode(void) const {
PRBool result=PRBool(mCharSize==eTwoByte);
return result;
}
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Getters/Setters...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
const PRUnichar* GetUnicode(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
/**
* Set nth character.
*/
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String concatenation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new subsumable string
*/
nsSubsumeStr operator+(const nsStr& aString);
nsSubsumeStr operator+(const nsString& aString);
/**
* create a new string by adding this to the given cstring
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const char* aCString);
/**
* create a new string by adding this to the given prunichar*.
* @param aString is a ptr to UC-string to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const PRUnichar* aString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(char aChar);
/**
* create a new string by adding this to the given char.
* @param aChar is a unichar to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsString& StripChars(const char* aSet);
nsString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsString& ReplaceChar(PRUnichar anOldChar,PRUnichar aNewChar);
nsString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
/**
* This method constructs a new nsString is a clone of this string.
*
*/
nsString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates an UTF8 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewUTF8String() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsString& Assign(const char* aString,PRInt32 aCount=-1);
nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Assign(char aChar);
nsString& Assign(PRUnichar aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
//nsString& operator+=(char aChar){return Append(aChar);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(PRUnichar aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsString& Append(const nsStr& aString) {return Append(aString,aString.mLength);}
nsString& Append(const nsString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsString& Append(const nsStr& aString,PRInt32 aCount);
nsString& Append(const nsString& aString,PRInt32 aCount);
nsString& Append(const char* aString,PRInt32 aCount=-1);
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(char aChar);
nsString& Append(PRUnichar aChar);
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsString& Insert(const nsString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
nsString& Insert(const PRUnichar* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
//nsString& Insert(char aChar,PRUint32 anOffset);
nsString& Insert(PRUnichar aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @param anOffset tells us where in this strig to start searching (counting from left)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching (counting from left)
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where in this strig to start searching (counting from left)
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsString &aString) const;
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char *aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsString &aString) const;
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsString &aString) const;
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsString &aString) const;
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsString &aString) const;
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsString &aString) const;
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars to be compared.
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const;
PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const;
PRBool EqualsIgnoreCase(const nsString& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const;
PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const;
/**
* Determine if given buffer is plain ascii
*
* @param aBuffer -- if null, then we test *this, otherwise we test given buffer
* @return TRUE if is all ascii chars or if strlen==0
*/
PRBool IsASCII(const PRUnichar* aBuffer=0);
/**
* Determine if given char is a valid space character
*
* @param aChar is character to be tested
* @return TRUE if is valid space char
*/
static PRBool IsSpace(PRUnichar ch);
/**
* Determine if given char in valid alpha range
*
* @param aChar is character to be tested
* @return TRUE if in alpha range
*/
static PRBool IsAlpha(PRUnichar ch);
/**
* Determine if given char is valid digit
*
* @param aChar is character to be tested
* @return TRUE if char is a valid digit
*/
static PRBool IsDigit(PRUnichar ch);
static void Recycle(nsString* aString);
static nsString* CreateString(void);
};
extern NS_COM int fputs(const nsString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsAutoString : public nsString {
public:
nsAutoString();
nsAutoString(const char* aCString,PRInt32 aLength=-1);
nsAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsAutoString(const CBufDescriptor& aBuffer);
nsAutoString(const nsStr& aString);
nsAutoString(const nsAutoString& aString);
#ifdef AIX
nsAutoString(const nsSubsumeStr& aSubsumeStr); // AIX requires a const
#else
nsAutoString(nsSubsumeStr& aSubsumeStr);
#endif // AIX
nsAutoString(PRUnichar aChar);
virtual ~nsAutoString();
nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;}
nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;}
nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;}
nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize<<eTwoByte];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeStr : public nsString {
public:
nsSubsumeStr(nsStr& aString);
nsSubsumeStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

View File

@@ -0,0 +1,179 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDebug.h"
#include "nsIAllocator.h"
#include "nsXPIDLString.h"
#include "plstr.h"
// If the allocator changes, fix it here.
#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar)))
#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char)))
#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr))
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
nsXPIDLString::nsXPIDLString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLString::~nsXPIDLString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLString::operator const PRUnichar*()
{
return mBuf;
}
PRUnichar*
nsXPIDLString::Copy(const PRUnichar* aString)
{
NS_ASSERTION(aString, "null ptr");
if (! aString)
return 0;
PRInt32 len = 0;
{
const PRUnichar* p = aString;
while (*p++)
len++;
}
PRUnichar* result = XPIDL_STRING_ALLOC(len + 1);
if (result) {
PRUnichar* q = result;
while (*aString) {
*q = *aString;
q++;
aString++;
}
*q = '\0';
}
return result;
}
PRUnichar**
nsXPIDLString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const PRUnichar**
nsXPIDLString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const PRUnichar**) &mBuf;
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
nsXPIDLCString::nsXPIDLCString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLCString::~nsXPIDLCString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = Copy(aCString);
mBufOwner = PR_TRUE;
return *this;
}
nsXPIDLCString::operator const char*()
{
return mBuf;
}
char*
nsXPIDLCString::Copy(const char* aCString)
{
NS_ASSERTION(aCString, "null ptr");
if (! aCString)
return 0;
PRInt32 len = PL_strlen(aCString);
char* result = XPIDL_CSTRING_ALLOC(len + 1);
if (result)
PL_strcpy(result, aCString);
return result;
}
char**
nsXPIDLCString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const char**
nsXPIDLCString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const char**) &mBuf;
}

View File

@@ -0,0 +1,302 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
A set of string wrapper classes that ease transition to use of XPIDL
interfaces. nsXPIDLString and nsXPIDLCString are to XPIDL `wstring'
and `string' out params as nsCOMPtr is to generic XPCOM interface
pointers. They help you deal with object ownership.
Consider the following interface:
interface nsIFoo {
attribute string Bar;
};
This will generate the following C++ header file:
class nsIFoo {
NS_IMETHOD SetBar(const PRUnichar* aValue);
NS_IMETHOD GetBar(PRUnichar* *aValue);
};
The GetBar() method will allocate a copy of the nsIFoo object's
"bar" attribute, and leave you to deal with freeing it:
nsIFoo* aFoo; // assume we get this somehow
PRUnichar* bar;
aFoo->GetFoo(&bar);
// Use bar here...
printf("bar is %s!\n", bar);
nsAllocator::Free(bar);
This makes your life harder, because you need to convolute your code
to ensure that you don't leak `bar'.
Enter nsXPIDLString, which manages the ownership of the allocated
string, and automatically destroys it when the nsXPIDLString goes
out of scope:
nsIFoo* aFoo;
nsXPIDLString bar;
aFoo->GetFoo( getter_Copies(bar) );
// Use bar here...
printf("bar is %s!\n", (const char*) bar);
// no need to remember to nsAllocator::Free().
Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it
painfully clear exactly what the code expects. You need to wrap an
nsXPIDLString object with either `getter_Copies()' or
`getter_Shares()' before passing it to a getter: these tell the
nsXPIDLString how ownership is being handled.
In the case of `getter_Copies()', the callee is allocating a copy
(which is usually the case). In the case of `getter_Shares()', the
callee is returning a const reference to `the real deal' (this can
be done using the [shared] attribute in XPIDL).
*/
#ifndef nsXPIDLString_h__
#define nsXPIDLString_h__
#include "nsCom.h"
#include "prtypes.h"
#ifndef __PRUNICHAR__
#define __PRUNICHAR__
typedef PRUint16 PRUnichar;
#endif /* __PRUNICHAR__ */
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |PRUnichar*| interface for |wstring| parameters in
// XPIDL interfaces.
//
class NS_COM nsXPIDLString {
private:
PRUnichar* mBuf;
PRBool mBufOwner;
PRUnichar** StartAssignmentByValue();
const PRUnichar** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a Unicode string.
*/
nsXPIDLString();
virtual ~nsXPIDLString();
/**
* Return a reference to the immutable Unicode string.
*/
operator const PRUnichar*();
/**
* Make a copy of the Unicode string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static PRUnichar* Copy(const PRUnichar* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLString& mXPIDLString;
public:
GetterCopies(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator PRUnichar**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLString& mXPIDLString;
public:
GetterShares(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const PRUnichar**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {}
nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive an |out| value.
*/
inline nsXPIDLString::GetterCopies
getter_Copies(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLString::GetterShares
getter_Shares(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterShares(aXPIDLString);
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |char*| interface for |string| parameters in XPIDL
// interfaces.
//
class NS_COM nsXPIDLCString {
private:
char* mBuf;
PRBool mBufOwner;
char** StartAssignmentByValue();
const char** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a single-byte string.
*/
nsXPIDLCString();
virtual ~nsXPIDLCString();
/**
* Assign a single-byte string to this wrapper. Copies and owns the result.
*/
nsXPIDLCString& operator =(const char* aString);
/**
* Return a reference to the immutable single-byte string.
*/
operator const char*();
/**
* Make a copy of the single-byte string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static char* Copy(const char* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterCopies(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator char**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLCString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterShares(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const char**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLCString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {}
nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive an |out| value.
*/
inline nsXPIDLCString::GetterCopies
getter_Copies(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLCString::GetterShares
getter_Shares(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterShares(aXPIDLString);
}
#endif // nsXPIDLString_h__

View File

@@ -1,28 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
include $(topsrcdir)/config/rules.mk

View File

@@ -1,21 +0,0 @@
rem -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
rem
rem The contents of this file are subject to the Netscape Public License
rem Version 1.0 (the "NPL"); you may not use this file except in
rem compliance with the NPL. You may obtain a copy of the NPL at
rem http://www.mozilla.org/NPL/
rem
rem Software distributed under the NPL is distributed on an "AS IS" basis,
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
rem for the specific language governing rights and limitations under the
rem NPL.
rem
rem The Initial Developer of this code under the NPL is Netscape
rem Communications Corporation. Portions created by Netscape are
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
rem Reserved.
rem
del s:\ns\raptor\ui\src\windows\win32_d.obj\%1.obj
del s:\ns\raptor\ui\tests\windows\win32_d.obj\winmain.obj
nmake -f makefile.win

View File

@@ -1,11 +0,0 @@
//
// Widget.Prefix
//
// Global prefix file for the Widget project.
//
#include "MacPrefix.h"
#include <Quickdraw.h>
#include <Events.h>
#include <MacWindows.h>

View File

@@ -1,11 +0,0 @@
//
// WidgetDebug.Prefix
//
// Global prefix file for the debug Widget project.
//
#include "MacPrefix_debug.h"
#include <Quickdraw.h>
#include <Events.h>
#include <MacWindows.h>

View File

@@ -1,22 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define MAC_SHARED 1
#define _IMPL_NS_WIDGET 1
#include "WidgetDebug.prefix"

View File

@@ -1,22 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define MAC_SHARED 1
#define _IMPL_NS_WIDGET 1
#include "Widget.prefix"

View File

@@ -1,21 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define MAC_STATIC 1
#include "WidgetDebug.prefix"

View File

@@ -1,21 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define MAC_STATIC 1
#include "Widget.prefix"

Binary file not shown.

View File

@@ -1,35 +0,0 @@
# target: widgetDebug.shlb
mozilla/widget/src/mac/nsAppShell.cpp
mozilla/widget/src/mac/nsButton.cpp
mozilla/widget/src/mac/nsCheckButton.cpp
mozilla/widget/src/mac/nsFileWidget.cpp
mozilla/widget/src/mac/nsLookAndFeel.cpp
mozilla/widget/src/mac/nsMacControl.cpp
mozilla/widget/src/mac/nsMacEventHandler.cpp
mozilla/widget/src/mac/nsMacMessagePump.cpp
mozilla/widget/src/mac/nsMacMessageSink.cpp
mozilla/widget/src/mac/nsMacWindow.cpp
mozilla/widget/src/mac/nsMenu.cpp
mozilla/widget/src/mac/nsMenuBar.cpp
mozilla/widget/src/mac/nsMenuItem.cpp
mozilla/widget/src/mac/nsRadioButton.cpp
mozilla/widget/src/mac/nsScrollbar.cpp
mozilla/widget/src/mac/nsTextAreaWidget.cpp
mozilla/widget/src/mac/nsTextWidget.cpp
mozilla/widget/src/mac/nsToolkit.cpp
mozilla/widget/src/mac/nsWidgetFactory.cpp
mozilla/widget/src/mac/nsWidgetSupport.cpp
mozilla/widget/src/mac/nsWindow.cpp
mozilla/widget/src/xpwidgets/nsBaseWidget.cpp
mozilla/widget/src/xpwidgets/nsHTColumn.cpp
mozilla/widget/src/xpwidgets/nsHTControlStripItem.cpp
mozilla/widget/src/xpwidgets/nsHTDataModel.cpp
mozilla/widget/src/xpwidgets/nsHTItem.cpp
mozilla/widget/src/xpwidgets/nsHTTreeDataModel.cpp
mozilla/widget/src/xpwidgets/nsHTTreeItem.cpp
mozilla/widget/src/xpwidgets/nsImageButton.cpp
mozilla/widget/src/xpwidgets/nsMenuButton.cpp
mozilla/widget/src/xpwidgets/nsToolbar.cpp
mozilla/widget/src/xpwidgets/nsToolbarItemHolder.cpp
mozilla/widget/src/xpwidgets/nsToolbarManager.cpp
mozilla/widget/src/xpwidgets/nsTreeView.cpp

View File

@@ -1,23 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=..
DIRS=public timer src
include <$(DEPTH)\config\rules.mak>

View File

@@ -1,33 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist:widget directory
#
nsIDragSessionMac.h
nsIWidget.h
nsIKBStateControl.h
nsIButton.h
nsICheckButton.h
nsIListWidget.h
nsIComboBox.h
nsITextWidget.h
nsITextAreaWidget.h
nsIComboBox.h
nsIListBox.h
nsIScrollbar.h
nsGUIEvent.h
nsIRadioButton.h
nsIMouseListener.h
nsIEventListener.h
nsIFileWidget.h
nsIMenuListener.h
nsWidgetsCID.h
nsILabel.h
nsILookAndFeel.h
nsWidgetSupport.h
nsIMenu.h
nsIMenuBar.h
nsIMenuItem.h
nsIPopUpMenu.h
nsIKeyBindMgr.h
nsStringUtil.h
nsIContextMenu.h

View File

@@ -1,16 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist:idl directory
#
nsIAppShell.idl
nsIFilePicker.idl
nsIFileSpecWithUI.idl
nsISound.idl
nsIToolkit.idl
nsITransferable.idl
nsIDragSession.idl
nsIDragService.idl
nsIFormatConverter.idl
nsIClipboard.idl
nsIClipboardOwner.idl
nsIRollupListener.idl

View File

@@ -1,92 +0,0 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = raptor
XPIDL_MODULE = widget
EXPORTS = \
nsIFontSizeIterator.h \
nsIFontNameIterator.h \
nsIFontRetrieverService.h \
nsIMenuBar.h \
nsIMenu.h \
nsIMenuItem.h \
nsIPopUpMenu.h \
nsIFileWidget.h \
nsStringUtil.h \
nsIKBStateControl.h \
nsIButton.h \
nsICheckButton.h \
nsIListWidget.h \
nsIComboBox.h \
nsITextWidget.h \
nsITextAreaWidget.h \
nsIComboBox.h \
nsIListBox.h \
nsIScrollbar.h \
nsGUIEvent.h \
nsIRadioButton.h \
nsIMouseListener.h \
nsIEventListener.h \
nsIMenuListener.h \
nsWidgetsCID.h \
nsILookAndFeel.h \
nsILabel.h \
nsIMenuBar.h \
nsIMenu.h \
nsIMenuItem.h \
nsIPopUpMenu.h \
nsIFontNameIterator.h \
nsIFontSizeIterator.h \
nsIFontRetrieverService.h \
nsIContextMenu.h \
$(NULL)
XPIDLSRCS = \
nsIAppShell.idl \
nsIFilePicker.idl \
nsIFileSpecWithUI.idl \
nsIToolkit.idl \
nsISound.idl \
nsITransferable.idl \
nsIDragSession.idl \
nsIDragService.idl \
nsIFormatConverter.idl \
nsIClipboard.idl \
nsIClipboardOwner.idl \
nsIRollupListener.idl \
nsIWidget.idl \
nsIWindow.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_UI

View File

@@ -1,78 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..
DEFINES=-D_IMPL_NS_UI
MODULE=raptor
XPIDL_MODULE=widget
XPIDLSRCS = \
.\nsIAppShell.idl \
.\nsIFilePicker.idl \
.\nsIFileSpecWithUI.idl \
.\nsISound.idl \
.\nsIToolkit.idl \
.\nsITransferable.idl \
.\nsIDragSession.idl \
.\nsIDragService.idl \
.\nsIFormatConverter.idl \
.\nsIClipboard.idl \
.\nsIClipboardOwner.idl \
.\nsIRollupListener.idl \
$(NULL)
EXPORTS=\
nsIFontSizeIterator.h \
nsIFontNameIterator.h \
nsIFontRetrieverService.h \
nsIFileWidget.h \
nsIWidget.h \
nsIKBStateControl.h \
nsIButton.h \
nsICheckButton.h \
nsIListWidget.h \
nsIComboBox.h \
nsITextWidget.h \
nsITextAreaWidget.h \
nsIComboBox.h \
nsIListBox.h \
nsIScrollbar.h \
nsGUIEvent.h \
nsIRadioButton.h \
nsIMouseListener.h \
nsIEventListener.h \
nsIMenuListener.h \
nsWidgetsCID.h \
nsStringUtil.h \
nsILookAndFeel.h \
nsILabel.h \
nsIMenuBar.h \
nsIMenu.h \
nsIMenuItem.h \
nsIContextMenu.h \
nsIPopUpMenu.h \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -1,509 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsGUIEvent_h__
#define nsGUIEvent_h__
#include "nsPoint.h"
#include "nsRect.h"
class nsIRenderingContext;
class nsIRegion;
class nsIWidget;
class nsIMenuItem;
/**
* Return status for event processors.
*/
enum nsEventStatus {
/// The event is ignored, do default processing
nsEventStatus_eIgnore,
/// The event is consumed, don't do default processing
nsEventStatus_eConsumeNoDefault,
/// The event is consumed, but do default processing
nsEventStatus_eConsumeDoDefault
};
/**
* General event
*/
struct nsEvent {
/// See event struct types
PRUint8 eventStructType;
/// See GUI MESSAGES,
PRUint32 message;
/// in widget relative coordinates, modified to be relative to current view in layout.
nsPoint point;
// in widget relative coordinates, not modified by layout code.
nsPoint refPoint;
/// elapsed time, in milliseconds, from the time the system was started to the time the message was created
PRUint32 time;
// flags to hold event flow stage and capture/bubble cancellation status
PRUint32 flags;
};
/**
* General graphic user interface event
*/
struct nsGUIEvent : public nsEvent {
/// Originator of the event
nsIWidget* widget;
/// Internal platform specific message.
void* nativeMsg;
};
/**
* Window resize event
*/
struct nsSizeEvent : public nsGUIEvent {
/// x,y width, height in pixels (client area)
nsRect *windowSize;
/// width of entire window (in pixels)
PRInt32 mWinWidth;
/// height of entire window (in pixels)
PRInt32 mWinHeight;
};
/**
* Window repaint event
*/
struct nsPaintEvent : public nsGUIEvent {
/// Context to paint in.
nsIRenderingContext *renderingContext;
/// area to paint (should be used instead of rect)
nsIRegion *region;
/// x,y, width, height in pixels of area to paint
nsRect *rect;
};
/**
* Scrollbar event
*/
struct nsScrollbarEvent : public nsGUIEvent {
/// ranges between scrollbar 0 and (maxRange - thumbSize). See nsIScrollbar
PRUint32 position;
};
struct nsInputEvent : public nsGUIEvent {
/// PR_TRUE indicates the shift key is down
PRBool isShift;
/// PR_TRUE indicates the control key is down
PRBool isControl;
/// PR_TRUE indicates the alt key is down
PRBool isAlt;
/// PR_TRUE indicates the meta key is down
/// (or, on Mac, the Command key)
PRBool isMeta;
};
/**
* Mouse event
*/
struct nsMouseEvent : public nsInputEvent {
/// The number of mouse clicks
PRUint32 clickCount;
/// Special return code for MOUSE_ACTIVATE to signal
/// if the target accepts activation (1), or denies it (0)
PRBool acceptActivation;
};
/**
* Keyboard event
*/
struct nsKeyEvent : public nsInputEvent {
/// see NS_VK codes
PRUint32 keyCode;
/// OS translated Unicode char
PRUint32 charCode;
// indicates whether the event signifies a printable character
PRBool isChar;
};
/**
* IME Related Events
*/
struct nsTextRange {
PRUint32 mStartOffset;
PRUint32 mEndOffset;
PRUint32 mRangeType;
};
typedef struct nsTextRange nsTextRange;
typedef nsTextRange* nsTextRangeArray;
struct nsTextEventReply {
nsPoint mCursorPosition;
PRBool mCursorIsCollapsed;
};
typedef struct nsTextEventReply nsTextEventReply;
struct nsTextEvent : public nsInputEvent {
PRUnichar* theText;
nsTextEventReply theReply;
PRUint32 rangeCount;
nsTextRangeArray rangeArray;
PRBool isChar;
};
struct nsCompositionEvent : public nsInputEvent {
PRUint32 compositionMessage;
nsTextEventReply theReply;
};
/**
* Tooltip event
*/
struct nsTooltipEvent : public nsGUIEvent {
/// Index of tooltip area which generated the event. @see SetTooltips in nsIWidget
PRUint32 tipIndex;
};
/**
* MenuItem event
*
* When this event occurs the widget field in nsGUIEvent holds the "target"
* for the event
*/
struct nsMenuEvent : public nsGUIEvent {
nsIMenuItem * mMenuItem;
PRUint32 mCommand;
};
/**
* Event status for D&D Event
*/
enum nsDragDropEventStatus {
/// The event is a enter
nsDragDropEventStatus_eDragEntered,
/// The event is exit
nsDragDropEventStatus_eDragExited,
/// The event is drop
nsDragDropEventStatus_eDrop
};
/**
* Event Struct Types
*/
#define NS_EVENT 1
#define NS_GUI_EVENT 2
#define NS_SIZE_EVENT 3
#define NS_PAINT_EVENT 4
#define NS_SCROLLBAR_EVENT 5
#define NS_INPUT_EVENT 6
#define NS_KEY_EVENT 7
#define NS_MOUSE_EVENT 8
#define NS_MENU_EVENT 10
#define NS_DRAGDROP_EVENT 11
#define NS_TEXT_EVENT 12
#define NS_COMPOSITION_START 13
#define NS_COMPOSITION_END 14
/**
* GUI MESSAGES
*/
//@{
#define NS_WINDOW_START 100
// Widget is being created
#define NS_CREATE (NS_WINDOW_START)
// Widget is being destroyed
#define NS_DESTROY (NS_WINDOW_START + 1)
// Widget was resized
#define NS_SIZE (NS_WINDOW_START + 2)
// Widget gained focus
#define NS_GOTFOCUS (NS_WINDOW_START + 3)
// Widget lost focus
#define NS_LOSTFOCUS (NS_WINDOW_START + 4)
// Widget got activated
#define NS_ACTIVATE (NS_WINDOW_START + 5)
// Widget got deactivated
#define NS_DEACTIVATE (NS_WINDOW_START + 6)
// Widget needs to be repainted
#define NS_PAINT (NS_WINDOW_START + 30)
// Key is pressed within a window
#define NS_KEY_PRESS (NS_WINDOW_START + 31)
// Key is released within a window
#define NS_KEY_UP (NS_WINDOW_START + 32)
// Key is pressed within a window
#define NS_KEY_DOWN (NS_WINDOW_START + 33)
// Window has been moved to a new location.
// The events point contains the x, y location in screen coordinates
#define NS_MOVE (NS_WINDOW_START + 34)
// Tab control's selected tab has changed
#define NS_TABCHANGE (NS_WINDOW_START + 35)
// Menu item selected
#define NS_MENU_SELECTED (NS_WINDOW_START + 38)
// Form control changed: currently == combo box selection changed
// but could be expanded to mean textbox, checkbox changed, etc.
// This is a GUI specific event that does not necessarily correspond
// directly to a mouse click or a key press.
#define NS_CONTROL_CHANGE (NS_WINDOW_START + 39)
// Indicates the display has changed depth
#define NS_DISPLAYCHANGED (NS_WINDOW_START + 40)
#define NS_MOUSE_MESSAGE_START 300
#define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START)
#define NS_MOUSE_LEFT_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1)
#define NS_MOUSE_LEFT_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2)
#define NS_MOUSE_MIDDLE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 10)
#define NS_MOUSE_MIDDLE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 11)
#define NS_MOUSE_RIGHT_BUTTON_UP (NS_MOUSE_MESSAGE_START + 20)
#define NS_MOUSE_RIGHT_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 21)
#define NS_MOUSE_ENTER (NS_MOUSE_MESSAGE_START + 22)
#define NS_MOUSE_EXIT (NS_MOUSE_MESSAGE_START + 23)
#define NS_MOUSE_LEFT_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24)
#define NS_MOUSE_MIDDLE_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 25)
#define NS_MOUSE_RIGHT_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 26)
#define NS_MOUSE_LEFT_CLICK (NS_MOUSE_MESSAGE_START + 27)
#define NS_MOUSE_MIDDLE_CLICK (NS_MOUSE_MESSAGE_START + 28)
#define NS_MOUSE_RIGHT_CLICK (NS_MOUSE_MESSAGE_START + 29)
#define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30)
#define NS_SCROLLBAR_MESSAGE_START 1000
#define NS_SCROLLBAR_POS (NS_SCROLLBAR_MESSAGE_START)
#define NS_SCROLLBAR_PAGE_NEXT (NS_SCROLLBAR_MESSAGE_START + 1)
#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2)
#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3)
#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4)
#define NS_STREAM_EVENT_START 1100
#define NS_PAGE_LOAD (NS_STREAM_EVENT_START)
#define NS_PAGE_UNLOAD (NS_STREAM_EVENT_START + 1)
#define NS_IMAGE_LOAD (NS_STREAM_EVENT_START + 2)
#define NS_IMAGE_ABORT (NS_STREAM_EVENT_START + 3)
#define NS_IMAGE_ERROR (NS_STREAM_EVENT_START + 4)
#define NS_FORM_EVENT_START 1200
#define NS_FORM_SUBMIT (NS_FORM_EVENT_START)
#define NS_FORM_RESET (NS_FORM_EVENT_START + 1)
#define NS_FORM_CHANGE (NS_FORM_EVENT_START + 2)
#define NS_FORM_SELECTED (NS_FORM_EVENT_START + 3)
#define NS_FORM_INPUT (NS_FORM_EVENT_START + 4)
//Need separate focus/blur notifications for non-native widgets
#define NS_FOCUS_EVENT_START 1300
#define NS_FOCUS_CONTENT (NS_FOCUS_EVENT_START)
#define NS_BLUR_CONTENT (NS_FOCUS_EVENT_START + 1)
#define NS_DRAGDROP_EVENT_START 1400
#define NS_DRAGDROP_ENTER (NS_DRAGDROP_EVENT_START)
#define NS_DRAGDROP_OVER (NS_DRAGDROP_EVENT_START + 1)
#define NS_DRAGDROP_EXIT (NS_DRAGDROP_EVENT_START + 2)
#define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 3)
#define NS_DRAGDROP_GESTURE (NS_DRAGDROP_EVENT_START + 4)
// Events for popups
#define NS_MENU_EVENT_START 1500
#define NS_MENU_CREATE (NS_MENU_EVENT_START)
#define NS_MENU_DESTROY (NS_MENU_EVENT_START+1)
#define NS_MENU_ACTION (NS_MENU_EVENT_START+2)
#define NS_XUL_BROADCAST (NS_MENU_EVENT_START+3)
#define NS_XUL_COMMAND_UPDATE (NS_MENU_EVENT_START+4)
//@}
#define NS_IS_MOUSE_EVENT(evnt) \
(((evnt)->message == NS_MOUSE_LEFT_BUTTON_DOWN) || \
((evnt)->message == NS_MOUSE_LEFT_BUTTON_UP) || \
((evnt)->message == NS_MOUSE_LEFT_CLICK) || \
((evnt)->message == NS_MOUSE_LEFT_DOUBLECLICK) || \
((evnt)->message == NS_MOUSE_MIDDLE_BUTTON_DOWN) || \
((evnt)->message == NS_MOUSE_MIDDLE_BUTTON_UP) || \
((evnt)->message == NS_MOUSE_MIDDLE_CLICK) || \
((evnt)->message == NS_MOUSE_MIDDLE_DOUBLECLICK) || \
((evnt)->message == NS_MOUSE_RIGHT_BUTTON_DOWN) || \
((evnt)->message == NS_MOUSE_RIGHT_BUTTON_UP) || \
((evnt)->message == NS_MOUSE_RIGHT_CLICK) || \
((evnt)->message == NS_MOUSE_RIGHT_DOUBLECLICK) || \
((evnt)->message == NS_MOUSE_ENTER) || \
((evnt)->message == NS_MOUSE_EXIT) || \
((evnt)->message == NS_MOUSE_MOVE))
#define NS_IS_KEY_EVENT(evnt) \
(((evnt)->message == NS_KEY_DOWN) || \
((evnt)->message == NS_KEY_PRESS) || \
((evnt)->message == NS_KEY_UP))
/*
* Virtual key bindings for keyboard events
* NOTE: These are repeated in nsIDOMEvent.h and must be kept in sync
*/
#define NS_VK_CANCEL 0x03
#define NS_VK_BACK 0x08
#define NS_VK_TAB 0x09
#define NS_VK_CLEAR 0x0C
#define NS_VK_RETURN 0x0D
#define NS_VK_ENTER 0x0E
#define NS_VK_SHIFT 0x10
#define NS_VK_CONTROL 0x11
#define NS_VK_ALT 0x12
#define NS_VK_PAUSE 0x13
#define NS_VK_CAPS_LOCK 0x14
#define NS_VK_ESCAPE 0x1B
#define NS_VK_SPACE 0x20
#define NS_VK_PAGE_UP 0x21
#define NS_VK_PAGE_DOWN 0x22
#define NS_VK_END 0x23
#define NS_VK_HOME 0x24
#define NS_VK_LEFT 0x25
#define NS_VK_UP 0x26
#define NS_VK_RIGHT 0x27
#define NS_VK_DOWN 0x28
#define NS_VK_PRINTSCREEN 0x2C
#define NS_VK_INSERT 0x2D
#define NS_VK_DELETE 0x2E
// NS_VK_0 - NS_VK_9 match their ascii values
#define NS_VK_0 0x30
#define NS_VK_1 0x31
#define NS_VK_2 0x32
#define NS_VK_3 0x33
#define NS_VK_4 0x34
#define NS_VK_5 0x35
#define NS_VK_6 0x36
#define NS_VK_7 0x37
#define NS_VK_8 0x38
#define NS_VK_9 0x39
#define NS_VK_SEMICOLON 0x3B
#define NS_VK_EQUALS 0x3D
// NS_VK_A - NS_VK_Z match their ascii values
#define NS_VK_A 0x41
#define NS_VK_B 0x42
#define NS_VK_C 0x43
#define NS_VK_D 0x44
#define NS_VK_E 0x45
#define NS_VK_F 0x46
#define NS_VK_G 0x47
#define NS_VK_H 0x48
#define NS_VK_I 0x49
#define NS_VK_J 0x4A
#define NS_VK_K 0x4B
#define NS_VK_L 0x4C
#define NS_VK_M 0x4D
#define NS_VK_N 0x4E
#define NS_VK_O 0x4F
#define NS_VK_P 0x50
#define NS_VK_Q 0x51
#define NS_VK_R 0x52
#define NS_VK_S 0x53
#define NS_VK_T 0x54
#define NS_VK_U 0x55
#define NS_VK_V 0x56
#define NS_VK_W 0x57
#define NS_VK_X 0x58
#define NS_VK_Y 0x59
#define NS_VK_Z 0x5A
#define NS_VK_NUMPAD0 0x60
#define NS_VK_NUMPAD1 0x61
#define NS_VK_NUMPAD2 0x62
#define NS_VK_NUMPAD3 0x63
#define NS_VK_NUMPAD4 0x64
#define NS_VK_NUMPAD5 0x65
#define NS_VK_NUMPAD6 0x66
#define NS_VK_NUMPAD7 0x67
#define NS_VK_NUMPAD8 0x68
#define NS_VK_NUMPAD9 0x69
#define NS_VK_MULTIPLY 0x6A
#define NS_VK_ADD 0x6B
#define NS_VK_SEPARATOR 0x6C
#define NS_VK_SUBTRACT 0x6D
#define NS_VK_DECIMAL 0x6E
#define NS_VK_DIVIDE 0x6F
#define NS_VK_F1 0x70
#define NS_VK_F2 0x71
#define NS_VK_F3 0x72
#define NS_VK_F4 0x73
#define NS_VK_F5 0x74
#define NS_VK_F6 0x75
#define NS_VK_F7 0x76
#define NS_VK_F8 0x77
#define NS_VK_F9 0x78
#define NS_VK_F10 0x79
#define NS_VK_F11 0x7A
#define NS_VK_F12 0x7B
#define NS_VK_F13 0x7C
#define NS_VK_F14 0x7D
#define NS_VK_F15 0x7E
#define NS_VK_F16 0x7F
#define NS_VK_F17 0x80
#define NS_VK_F18 0x81
#define NS_VK_F19 0x82
#define NS_VK_F20 0x83
#define NS_VK_F21 0x84
#define NS_VK_F22 0x85
#define NS_VK_F23 0x86
#define NS_VK_F24 0x87
#define NS_VK_NUM_LOCK 0x90
#define NS_VK_SCROLL_LOCK 0x91
#define NS_VK_COMMA 0xBC
#define NS_VK_PERIOD 0xBE
#define NS_VK_SLASH 0xBF
#define NS_VK_BACK_QUOTE 0xC0
#define NS_VK_OPEN_BRACKET 0xDB
#define NS_VK_BACK_SLASH 0xDC
#define NS_VK_CLOSE_BRACKET 0xDD
#define NS_VK_QUOTE 0xDE
#define NS_EVENT_FLAG_NONE 0x0000
#define NS_EVENT_FLAG_INIT 0x0001
#define NS_EVENT_FLAG_BUBBLE 0x0002
#define NS_EVENT_FLAG_CAPTURE 0x0004
#define NS_EVENT_FLAG_STOP_DISPATCH 0x0008
#define NS_EVENT_FLAG_NO_DEFAULT 0x0010
// IME Constants -- keep in synch with nsIDOMTextRange.h
#define NS_TEXTRANGE_CARETPOSITION 0x01
#define NS_TEXTRANGE_RAWINPUT 0X02
#define NS_TEXTRANGE_SELECTEDRAWTEXT 0x03
#define NS_TEXTRANGE_CONVERTEDTEXT 0x04
#define NS_TEXTRANGE_SELECTEDCONVERTEDTEXT 0x05
#endif // nsGUIEvent_h__

View File

@@ -1,122 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#include "nsISupports.idl"
native int(int);
[ptr] native nsDispatchListener(nsDispatchListener);
[ptr] native nsIEventQueue(nsIEventQueue);
[ptr] native UndefinednsIWidget(nsIWidget);
[ref] native PRBoolRef(PRBool);
[ref] native voidStarRef(void *);
%{ C++
#include "nsIEventQueue.h"
/**
* Flags for the getNativeData function.
* See GetNativeData()
*/
#define NS_NATIVE_SHELL 0
/**
* During the nsIAppShell Run method notify this listener
* after each message dispatch.
* @see SetDispatchListener member function of nsIAppShell
*/
class nsDispatchListener {
public:
virtual void AfterDispatch() = 0;
};
class nsIWidget;
%}
[uuid(a0757c31-eeac-11d1-9ec1-00aa002fb821)]
interface nsIAppShell : nsISupports
{
/**
* Creates an application shell
*/
void Create(inout int argc, inout string argv);
/**
* Enter an event loop.
* Don't leave until application exits.
*/
void Run();
/**
* Prepare to process events.
*/
void Spinup();
/**
* Prepare to stop processing events.
*/
void Spindown();
/**
* An event queue has been created or destroyed. Hook or unhook it from
* your system, as necessary.
* @param aQueue the queue in question
* @param aListen PR_TRUE for a new queue wanting hooking up. PR_FALSE
* for a queue wanting to be unhooked.
*/
void ListenToEventQueue(in nsIEventQueue aQueue, in PRBool aListen);
/**
* After event dispatch execute app specific code
*/
void GetNativeEvent(in PRBoolRef aRealEvent, in voidStarRef aEvent);
/**
* After event dispatch execute app specific code
*/
void DispatchNativeEvent(in PRBool aRealEvent, in voidStar aEvent);
/**
* After event dispatch execute app specific code
*/
void SetDispatchListener(in nsDispatchListener aDispatchListener);
/**
* Exit the handle event loop
*/
void Exit();
};
#endif // nsIAppShell_h__

View File

@@ -1,63 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIButton_h__
#define nsIButton_h__
#include "nsIWidget.h"
#include "nsString.h"
// {18032AD0-B265-11d1-AA2A-000000000000}
#define NS_IBUTTON_IID \
{ 0x18032ad0, 0xb265, 0x11d1, \
{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
* Push button widget.
* Automatically shows itself as depressed when clicked on.
*/
class nsIButton : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBUTTON_IID)
/**
* Set the label
*
* @param Set the label to aText
* @result NS_Ok if no errors
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result NS_Ok if no errors
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
};
#endif

View File

@@ -1,81 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsICheckButton_h__
#define nsICheckButton_h__
// {961085F5-BD28-11d1-97EF-00609703C14E}
#define NS_ICHECKBUTTON_IID \
{ 0x961085f5, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
#include "nsISupports.h"
#include "nsIWidget.h"
/**
* Checkbox widget.
* Can show itself in a checked or unchecked state.
* The checkbox widget does not automatically show itself checked or unchecked when clicked on.
*/
class nsICheckButton : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHECKBUTTON_IID)
/**
* Set the button label
*
* @param aText button label
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
/**
* Set the check state.
* @param aState PR_TRUE show as checked. PR_FALSE show unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetState(const PRBool aState) = 0;
/**
* Get the check state.
* @param aState PR_TRUE if checked. PR_FALSE if unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetState(PRBool& aState) = 0;
};
#endif // nsICheckButton_h__

View File

@@ -1,88 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
* Communications Corp. All Rights Reserved.
*
* Contributor(s):
* Mike Pinkerton
*/
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsITransferable.idl"
#include "nsIClipboardOwner.idl"
[scriptable, uuid(8B5314BA-DB01-11d2-96CE-0060B0FB9956)]
interface nsIClipboard : nsISupports
{
/**
* Given a transferable, set the data on the native clipboard
*
* @param aTransferable The transferable
* @param anOwner The owner of the transferable
* @result NS_Ok if no errors
*/
void setData ( in nsITransferable aTransferable, in nsIClipboardOwner anOwner) ;
/**
* Given a transferable, get the clipboard data.
*
* @param aTransferable The transferable
* @result NS_Ok if no errors
*/
void getData ( in nsITransferable aTransferable ) ;
/**
* This empties the clipboard and notifies the clipboard owner.
* This empties the "logical" clipboard. It does not clear the native clipboard.
*
* @result NS_OK if successful.
*/
void emptyClipboard ( ) ;
/**
* Some platforms support deferred notification for putting data on the clipboard
* This method forces the data onto the clipboard in its various formats
* This may be used if the application going away.
*
* @result NS_OK if successful.
*/
void forceDataToClipboard ( ) ;
/**
* This provides a way to give correct UI feedback about, for instance, a paste
* should be allowed. It does _NOT_ actually retreive the data and should be a very
* inexpensive call. All it does is check if there is data on the clipboard matching
* any of the flavors in the given list.
*
* @aFlavorList - nsISupportsString's in a nsISupportsArray (for JavaScript).
* @outResult - if data is present matching one of
* @result NS_OK if successful.
*/
boolean hasDataMatchingFlavors ( in nsISupportsArray aFlavorList ) ;
};
%{ C++
%}

View File

@@ -1,45 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
* Communications Corp. All Rights Reserved.
*
* Contributor(s):
* Mike Pinkerton
*/
#include "nsISupports.idl"
#include "nsITransferable.idl"
[scriptable, uuid(5A31C7A1-E122-11d2-9A57-000064657374)]
interface nsIClipboardOwner : nsISupports
{
/**
* Notifies the owner of the clipboard transferable that the
* transferable is being removed from the clipboard
*
* @param aTransferable The transferable
* @result NS_Ok if no errors
*/
void LosingOwnership ( in nsITransferable aTransferable ) ;
};
%{ C++
%}

View File

@@ -1,141 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIComboBox_h__
#define nsIComboBox_h__
#include "nsIListWidget.h"
#include "nsString.h"
// {961085F6-BD28-11d1-97EF-00609703C14E}
#define NS_ICOMBOBOX_IID \
{ 0x961085f6, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Initialize combobox data
*/
struct nsComboBoxInitData : public nsWidgetInitData {
nsComboBoxInitData()
: mDropDownHeight(0)
{
}
PRUint32 mDropDownHeight; // in pixels
};
/**
* Single selection drop down list. See nsIListWidget for capabilities
*/
class nsIComboBox : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOMBOBOX_IID);
/**
* Set an item at the specific position
*
* @param aItem the item name. The item has to be null terminated
* @param aPosition the position the item should be inserted at
* 0 is at the top of the list
* -1 is at the end of the list
*/
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition) = 0;
/**
* Finds the first occurrence of the specified item
*
* @param aItem the string to be filled
* @param aStartPos the starting position (index)
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos) = 0;
/**
* Returns the number of items in the list
*
* @return the number of items
*
*/
virtual PRInt32 GetItemCount() = 0;
/**
* Remove the first occurrence of the specified item
*
* @param aPosition the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRBool RemoveItemAt(PRInt32 aPosition) = 0;
/**
* Gets an item at a specific location
*
* @param anItem on return contains the string of the item at that position
* @param aPosition the Position of the item
*
*/
virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition) = 0;
/**
* Gets the selected item for a single selection list
*
* @param aItem on return contains the string of the selected item
*
*/
NS_IMETHOD GetSelectedItem(nsString &aItem) = 0;
/**
* Returns with the index of the selected item
*
* @return PRInt32, index of selected item
*
*/
virtual PRInt32 GetSelectedIndex() = 0;
/**
* Select the item at the specified position
*
* @param PRInt32, the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
*/
NS_IMETHOD SelectItem(PRInt32 aPosition) = 0;
/**
* Deselects all the items in the list
*
*/
NS_IMETHOD Deselect() = 0;
};
#endif // nsIComboBox_h__

View File

@@ -1,148 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIContextMenu_h__
#define nsIContextMenu_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIWebShell.h"
class nsIMenuBar;
class nsIMenu;
class nsIMenuItem;
class nsIMenuListener;
//Generate this!
// {35A3DEC1-4992-11d2-8DBA-00609703C14E}
#define NS_ICONTEXTMENU_IID \
{ 0x35a3dec1, 0x4992, 0x11d2, \
{ 0x8d, 0xba, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Menu widget
*/
class nsIContextMenu : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTEXTMENU_IID)
/**
* Creates the context menu
*
*/
NS_IMETHOD Create(nsISupports * aParent, const nsString& anAlignment, const nsString& anAnchorAlignment) = 0;
/**
* Get the context menu's Parent
*
*/
NS_IMETHOD GetParent(nsISupports *&aParent) = 0;
/**
* Adds a context menu Item
*
*/
NS_IMETHOD AddItem(nsISupports* aItem) = 0;
/**
* Adds a separator
*
*/
NS_IMETHOD AddSeparator() = 0;
/**
* Returns the number of context menu items
* This does count separators as items
*/
NS_IMETHOD GetItemCount(PRUint32 &aCount) = 0;
/**
* Returns a Menu or Menu Item at a specified Index
*
*/
NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem) = 0;
/**
* Inserts a Menu Item at a specified Index
*
*/
NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem) = 0;
/**
* Removes an Menu Item from a specified Index
*
*/
NS_IMETHOD RemoveItem(const PRUint32 aPos) = 0;
/**
* Removes all the Menu Items
*
*/
NS_IMETHOD RemoveAll() = 0;
/**
* Gets Native MenuHandle
*
*/
NS_IMETHOD GetNativeData(void** aData) = 0;
/**
* Adds menu listener for dynamic construction
*
*/
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Removes menu listener for dynamic construction
*
*/
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Set location
*
*/
NS_IMETHOD SetLocation(PRInt32 aX, PRInt32 aY) = 0;
/**
* Set DOMNode
*
*/
NS_IMETHOD SetDOMNode(nsIDOMNode * aMenuNode) = 0;
/**
* Set DOMElement
*
*/
NS_IMETHOD SetDOMElement(nsIDOMElement * aMenuElement) = 0;
/**
* Set WebShell
*
*/
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell) = 0;
};
#endif

View File

@@ -1,70 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
* Communications Corp. All Rights Reserved.
*
* Contributor(s):
* Mike Pinkerton
*/
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsIDragSession.idl"
#include "nsIScriptableRegion.idl"
[scriptable, uuid(8B5314BB-DB01-11d2-96CE-0060B0FB9956)]
interface nsIDragService : nsISupports
{
const long DRAGDROP_ACTION_NONE = 0;
const long DRAGDROP_ACTION_COPY = 1;
const long DRAGDROP_ACTION_MOVE = 2;
const long DRAGDROP_ACTION_LINK = 4;
/**
* Starts a modal drag session with an array of transaferables
*
* @param aTransferables - an array of transferables to be dragged
* @param aRegion - a region containing rectangles for cursor feedback,
* in window coordinates.
* @param aActionType - specified which of copy/move/link are allowed
*/
void invokeDragSession ( in nsISupportsArray aTransferables,
in nsIScriptableRegion aRegion, in unsigned long aActionType );
/**
* Returns the current Drag Session
*/
nsIDragSession getCurrentSession ( ) ;
/**
* Tells the Drag Service to start a drag session. This is called when
* an external drag occurs
*/
void startDragSession ( ) ;
/**
* Tells the Drag Service to end a drag session. This is called when
* an external drag occurs
*/
void endDragSession ( ) ;
};
%{ C++
%}

View File

@@ -1,80 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
* Communications Corp. All Rights Reserved.
*
* Contributor(s):
* Mike Pinkerton
*/
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsITransferable.idl"
%{ C++
#include "nsSize.h"
%}
native nsSize (nsSize);
[scriptable, uuid(CBA22C53-FCCE-11d2-96D4-0060B0FB9956)]
interface nsIDragSession : nsISupports
{
/**
* Set the current state of the drag whether it can be dropped or not.
* usually the target "frame" sets this so the native system can render the correct feedback
*/
attribute boolean canDrop;
/**
* Sets the action (copy, move, link, et.c) for the current drag
*/
attribute unsigned long dragAction;
/**
* Sets the current width and height if the drag target area.
* It will contain the current size of the Frame that the drag is currently in
*/
attribute nsSize targetSize;
/**
* Get the number items that were dropped
*/
readonly attribute unsigned long numDropItems;
/**
* Get data from a Drag&Drop. Can be called while the drag is in process
* or after the drop has completed.
*
* @param aTransferable the transferable for the data to be put into
* @param aItemIndex which of multiple drag items, zero-based
*/
void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ;
/**
* Check to set if ant of the native data on the clipboard matches this data flavor
*
* @result NS_OK if if the data flavor is supported and, NS_ERROR_FAILURE is it is not
*/
boolean isDataFlavorSupported ( in string aDataFlavor ) ;
};
%{ C++
%}

View File

@@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIDragSessionMac_h__
#define nsIDragSessionMac_h__
#include "nsISupports.h"
#include <Drag.h>
#define NS_IDRAGSESSIONMAC_IID \
{ 0x36c4c380, 0x09e2, 0x11d3, { 0xb0, 0x33, 0xa4, 0x20, 0xf4, 0x2c, 0xfd, 0x7c } };
class nsIDragSessionMac : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDRAGSESSIONMAC_IID)
/**
* Since the drag may originate in an external application, we need some way of
* communicating the DragManager's DragRef to the session so it can use it
* when filling in data requests.
*
* @param aDragRef the MacOS DragManager's ref number for the current drag
*/
NS_IMETHOD SetDragReference ( DragReference aDragRef ) = 0;
};
#endif

View File

@@ -1,52 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIEventListener_h__
#define nsIEventListener_h__
#include "nsISupports.h"
#include "nsGUIEvent.h"
/**
* Event listener interface.
* Alternative to a callback for recieving events.
*/
// {c83f6b80-d7ce-11d2-8360-c4c894c4917c}
#define NS_IEVENTLISTENER_IID \
{ 0xc83f6b80, 0xd7ce, 0x11d2, { 0x83, 0x60, 0xc4, 0xc8, 0x94, 0xc4, 0x91, 0x7c } }
class nsIEventListener : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEVENTLISTENER_IID)
/**
* Processes all events.
* If a mouse listener is registered this method will not process mouse events.
* @param anEvent the event to process. See nsGUIEvent.h for event types.
*/
virtual nsEventStatus ProcessEvent(const nsGUIEvent & anEvent) = 0;
};
#endif // nsIEventListener_h__

View File

@@ -1,75 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIFileDialogsMgr_h__
#define nsIFileDialogsMgr_h__
#include "nsISupports.h"
#include "nsFileSpec.h"
// {0ef98781-e34b-11d2-b345-00a0cc3c1cde}
#define NS_IFILEDIALOGSMGR_IID \
{ 0xef98781, 0xe34b, 0x11d2, { 0xb3, 0x45, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } }
#define NS_FILEDIALOGSMGR_CID \
{ 0xef98784, 0xe34b, 0x11d2, { 0xb3, 0x45, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } }
enum nsFileDlgResults {
nsFileDlgResults_Cancel, // User hit cancel, ignore selection
nsFileDlgResults_OK, // User hit Ok, process selection
nsFileDlgResults_Replace // User acknowledged file already exists so ok to replace, process selection
};
/**
* (native) File Dialogs utility.
* Provides an XP wrapper to platform native file dialogs:
* GetFile - Presents a file browser and returns an nsFileSpec for the selected file
* GetFolder - Presents a folder/path selection dialog and returns an nsFileSpec
* PutFile - Presents a file save dialog to the user and returns an nsFileSpec with
* the name and path to save the file
*
*/
class nsIFileDialogsMgr : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEDIALOGSMGR_IID)
NS_IMETHOD GetFile(
nsFileSpec & theFileSpec, // Populate with initial path for file dialog
nsFileDlgResults & theResult, // Result from the file selection dialog prompt
const nsString * promptString, // Window title for file selection dialog
void * filterList) = 0;
NS_IMETHOD GetFolder(
nsFileSpec & theFileSpec, // Populate with initial path for file dialog
nsFileDlgResults & theResult, // Result from the folder selection dialog prompt
const nsString * promptString) = 0; // Window title for folder selection dialog
NS_IMETHOD PutFile(
nsFileSpec & theFileSpec, // Populate with initial path for file dialog
nsFileDlgResults & theResult, // Result from the file save dialog prompt
const nsString * promptString) = 0; // Window title for file save dialog
};
#endif // nsIFileDialogsMgr_h__

View File

@@ -1,96 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#include "nsISupports.idl"
#include "nsIFileSpec.idl"
interface nsIDOMWindow;
[scriptable, uuid(c47de916-1dd1-11b2-8141-82507fa02b21)]
interface nsIFilePicker : nsISupports
{
const short modeLoad = 0; // Load a file or directory
const short modeSave = 1; // Save a file or directory
const short modeGetFolder = 2; // Select a fodler/directory
const short returnOK = 0; // User hit cancel, ignore selection
const short returnCancel = 1; // User hit Ok, process selection
const short returnReplace = 2; // User acknowledged file already exists so ok to replace, process selection
/**
* Create the file widget.
*
* @param parent nsIDOMWindow parent. This dialog should be dependant on this parent.
* @param title The title for the file widget
* @param mode load, save, or get folder
*
*/
void create(in nsIDOMWindow parent, in wstring title, in short mode);
/**
* Set the list of file filters
*
* @param titles array of filter titles
* @param filters array of filters to associate with titles
* @param numberOfFilters number of filters.
*
*/
void setFilterList(in long numberOfFilters,
[array, size_is(numberOfFilters)] in wstring titles,
[array, size_is(numberOfFilters)] in wstring filters);
/**
* Get the index into the filter list for the type of file the user wants to save
*
* @param selectedFilter the index of the selected item in the filter list
*
*/
readonly attribute long selectedFilter;
/* what is this? */
attribute wstring defaultString;
/**
* Set the directory that the file open/save dialog initially displays
*
* @param displayDirectory the name of the directory
*
*/
attribute nsIFileSpec displayDirectory;
/**
* Get the nsFileSpec for the file or directory.
*
* @return Returns the file currently selected
*/
readonly attribute nsIFileSpec file;
/**
* Show File Dialog. The dialog is displayed modally.
*
* @return returnOK if the user selects OK, returnCancel if the user selects cancel
*
*/
short show();
};

View File

@@ -1,112 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
// This is the only correct cross-platform way to specify a file.
// Strings are not such a way. If you grew up on windows or unix, you
// may think they are. Welcome to reality.
#include "nsIFileSpec.idl"
%{C++
#include "nscore.h" // for NS_WIDGET
#include "nsIComponentManager.h"
%}
native StandardFilterMask(nsIFileSpecWithUI::StandardFilterMask);
[scriptable, uuid(8ddf7681-139a-11d3-915f-dc1f8c138b7c)]
interface nsIFileSpecWithUI : nsIFileSpec
{
%{C++
//
// The "choose" functions present the file picker UI in order to set the
// value of the file spec.
%}
%{C++
// The mask for standard filters is given as follows:
enum StandardFilterMask
{
eAllReadable = (1<<0)
, eHTMLFiles = (1<<1)
, eXMLFiles = (1<<2)
, eImageFiles = (1<<3)
, eMailFiles = (1<<4)
, eTextFiles = (1<<5)
, eAllFiles = (1<<6)
// Mask containing all the above default filters
, eAllStandardFilters = (
eAllReadable
| eHTMLFiles
| eXMLFiles
| eImageFiles
| eMailFiles
| eTextFiles
| eAllFiles)
, eAllMailOutputFilters = (
eHTMLFiles
| eMailFiles
| eTextFiles)
// The "extra filter" bit should be set if the "extra filter"
// is passed in to chooseInputFile.
, eExtraFilter = (1<<31)
};
enum { kNumStandardFilters = 7, kNumMailFilters = 3 };
%}
[noscript] void chooseInputFile(
in string title
, in StandardFilterMask standardFilterMask
, in string extraFilterTitle
, in string extraFilter
);
[noscript] void chooseOutputFile(in string windowTitle,
in string suggestedLeafName,
in StandardFilterMask standardFilterMask);
string chooseFile(in string title);
string chooseDirectory(in string title);
};
%{C++
// Define Progid and CID
// {e3326a80-2816-11d3-a7e5-98cb48c74f3c}
#define NS_FILESPECWITHUI_CID \
{ 0xe3326a80, 0x2816, 0x11d3, { 0xa7, 0xe5, 0x98, 0xcb, 0x48, 0xc7, 0x4f, 0x3c } }
#define NS_FILESPECWITHUI_PROGID "component://netscape/filespecwithui"
#define NS_FILESPECWITHUI_CLASSNAME "nsIFileSpecWithUI"
// Factory methods
inline nsIFileSpecWithUI* NS_CreateFileSpecWithUI()
{
nsIFileSpecWithUI* spec = nsnull;
nsresult rv = nsComponentManager::CreateInstance(
(const char*)NS_FILESPECWITHUI_PROGID,
(nsISupports*)nsnull,
(const nsID&)nsIFileSpecWithUI::GetIID(),
(void**)&spec);
NS_ASSERTION(NS_SUCCEEDED(rv), "ERROR: Could not make a file spec.");
return spec;
}
%}

View File

@@ -1,178 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIFileWidget_h__
#define nsIFileWidget_h__
#include "nsString.h"
#include "nsFileSpec.h"
class nsIWidget;
class nsIDeviceContext;
class nsIAppShell;
class nsIToolkit;
// {F8030015-C342-11d1-97F0-00609703C14E}
#define NS_IFILEWIDGET_IID \
{ 0xf8030015, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* File selector mode
*/
enum nsFileDlgMode {
/// Load a file or directory
eMode_load,
/// Save a file or directory
eMode_save,
/// Select a fodler/directory
eMode_getfolder
};
enum nsFileDlgResults {
nsFileDlgResults_Cancel, // User hit cancel, ignore selection
nsFileDlgResults_OK, // User hit Ok, process selection
nsFileDlgResults_Replace // User acknowledged file already exists so ok to replace, process selection
};
/**
* File selector widget.
* Modally selects files for loading or saving from a list.
*/
class nsIFileWidget : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEWIDGET_IID)
/**
* Create the file filter. This differs from the standard
* widget Create method because it passes in the mode
*
* @param aParent the parent to place this widget into
* @param aTitle The title for the file widget
* @param aMode load or save
* @return void
*
*/
NS_IMETHOD Create(nsIWidget *aParent,
const nsString& aTitle,
nsFileDlgMode aMode,
nsIDeviceContext *aContext = nsnull,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
void *aInitData = nsnull) = 0;
/**
* Set the list of file filters
*
* @param aNumberOfFilter number of filters.
* @param aTitle array of filter titles
* @param aFilter array of filters to associate with titles
* @return void
*
*/
NS_IMETHOD SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[]) = 0;
/**
* Get the index into the filter list for the type of file the user wants to save
*
* @param theType the index into the filter list
* @return void
*
*/
NS_IMETHOD GetSelectedType(PRInt16& theType) = 0;
/**
* Show File Dialog. The dialog is displayed modally.
*
* @return PR_TRUE if user selects OK, PR_FALSE if user selects CANCEL
*
*/
virtual PRBool Show() = 0;
/**
* Get the nsFileSpec for the file or directory.
*
* @param aFile on exit it contains the file or directory selected
*/
NS_IMETHOD GetFile(nsFileSpec& aFile) = 0;
/**
* Set the default string that appears in file open/save dialog
*
* @param aString the name of the file
* @return void
*
*/
NS_IMETHOD SetDefaultString(const nsString& aString) = 0;
/**
* Set the directory that the file open/save dialog initially displays
*
* @param aDirectory the name of the directory
* @return void
*
*/
NS_IMETHOD SetDisplayDirectory(const nsFileSpec& aDirectory) = 0;
/**
* Get the directory that the file open/save dialog was last displaying
*
* @param aDirectory the name of the directory
* @return void
*
*/
NS_IMETHOD GetDisplayDirectory(nsFileSpec& aDirectory) = 0;
virtual nsFileDlgResults GetFile(
nsIWidget * aParent,
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog
virtual nsFileDlgResults GetFolder(
nsIWidget * aParent,
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog
virtual nsFileDlgResults PutFile(
nsIWidget * aParent,
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog
};
#endif // nsIFileWidget_h__

View File

@@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIFontNameIterator_h__
#define nsIFontNameIterator_h__
#include "nsISupports.h"
class nsString;
// {CEEB39D1-0949-11d3-9A87-0050046CDA96}
#define NS_IFONTNAMEITERATOR_IID \
{ 0xceeb39d1, 0x949, 0x11d3, { 0x9a, 0x87, 0x0, 0x50, 0x4, 0x6c, 0xda, 0x96 } };
class nsIFontNameIterator : public nsISupports
// Fonts are identified by strings, |Get| and |Advance| are distinct to facility wrapping
// with C++ objects as standard iterators.
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFONTNAMEITERATOR_IID)
NS_IMETHOD Reset() = 0;
// does not need to be called initially, returns iterator to initial state
NS_IMETHOD Get( nsString* aFontName ) = 0;
// returns an error when no more names are available
NS_IMETHOD Advance() = 0;
// returns an error when no more names are available
};
#endif

View File

@@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIFontRetrieverService_h__
#define nsIFontRetrieverService_h__
#include "nsISupports.h"
class nsIFontNameIterator;
class nsIFontSizeIterator;
class nsString;
// {285EF9B2-094A-11d3-9A87-0050046CDA96}
#define NS_IFONTRETRIEVERSERVICE_IID \
{ 0x285ef9b2, 0x94a, 0x11d3, { 0x9a, 0x87, 0x0, 0x50, 0x4, 0x6c, 0xda, 0x96 } };
class nsIFontRetrieverService : public nsISupports
// This (singleton) service exists soley as a factory to manufacture iterators
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFONTRETRIEVERSERVICE_IID)
NS_IMETHOD CreateFontNameIterator( nsIFontNameIterator** aIterator ) = 0;
NS_IMETHOD CreateFontSizeIterator( const nsString &aFontName, nsIFontSizeIterator** aIterator ) = 0;
NS_IMETHOD IsFontScalable( const nsString &aFontName, PRBool* aResult ) = 0;
};
#endif

View File

@@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIFontSizeIterator_h__
#define nsIFontSizeIterator_h__
#include "nsISupports.h"
class nsString;
// {285EF9B1-094A-11d3-9A87-0050046CDA96}
#define NS_IFONTSIZEITERATOR_IID \
{ 0x285ef9b1, 0x94a, 0x11d3, { 0x9a, 0x87, 0x0, 0x50, 0x4, 0x6c, 0xda, 0x96 } };
class nsIFontSizeIterator : public nsISupports
// Font sizes are identified with doubles (e.g., for the possibility of fractional sizes from MM, etc.).
// |Get| and |Advance| are distinct to facility wrapping with C++ objects as standard iterators.
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFONTSIZEITERATOR_IID)
NS_IMETHOD Reset() = 0;
// does not need to be called initially, returns iterator to initial state
NS_IMETHOD Get( double* aFontSize ) = 0;
// returns an error when no more sizes are available
NS_IMETHOD Advance() = 0;
// returns an error when no more sizes are available
};
#endif

View File

@@ -1,69 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
[scriptable, uuid(948A0023-E3A7-11d2-96CF-0060B0FB9956)]
interface nsIFormatConverter : nsISupports
{
/**
* Get the list of the "input" data flavors (mime types as nsISupportsString),
* in otherwords, the flavors that this converter can convert "from" (the
* incoming data to the converter).
*/
nsISupportsArray getInputDataFlavors ( ) ;
/**
* Get the list of the "output" data flavors (mime types as nsISupportsString),
* in otherwords, the flavors that this converter can convert "to" (the
* outgoing data to the converter).
*
* @param aDataFlavorList fills list with supported flavors
*/
nsISupportsArray getOutputDataFlavors ( ) ;
/**
* Determines whether a converion from one flavor to another is supported
*
* @param aFromFormatConverter flavor to convert from
* @param aFromFormatConverter flavor to convert to
*/
boolean canConvert ( in string aFromDataFlavor, in string aToDataFlavor ) ;
/**
* Converts from one flavor to another.
*
* @param aFromFormatConverter flavor to convert from
* @param aFromFormatConverter flavor to convert to (destination own the memory)
* @returns returns NS_OK if it was converted
*/
void convert ( in string aFromDataFlavor, in nsISupports aFromData, in unsigned long aDataLen,
in string aToDataFlavor, out nsISupports aToData, out unsigned long aDataToLen ) ;
};
%{ C++
%}

View File

@@ -1,60 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIKeyBindMgr_h__
#define nsIKeyBindMgr_h__
#include "nsISupports.h"
#include "nsIDOMNode.h"
#include "nsGUIEvent.h"
#include "nsIWebShell.h"
#include "nsIContent.h"
// {a91c0821-de58-11d2-b345-00a0cc3c1cde}
#define NS_IKEYBINDMGR_IID \
{ 0xa91c0821, 0xde58, 0x11d2, \
{ 0xb3, 0x45, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } }
// {8B5314BD-DB01-11d2-96CE-0060B0FB9977}
#define NS_KEYBINDMGR_CID \
{ 0x8b5314bd, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x77 } }
/**
* Keyboard Binding utility.
* Given a key event and a DOM node to search executes any 'key' command
* that matches the event
*/
class nsIKeyBindMgr : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IKEYBINDMGR_IID)
NS_IMETHOD ProcessKeyEvent(
nsIDOMDocument * domDoc,
const nsKeyEvent & theEvent,
nsIWebShell * webShell,
nsEventStatus & theStatus) = 0;
};
#endif // nsIKeyBindMgr_h__

View File

@@ -1,91 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsILabel_h__
#define nsILabel_h__
#include "nsIWidget.h"
#include "nsString.h"
/* F3131891-3DC7-11d2-8DB8-00609703C14E */
#define NS_ILABEL_IID \
{ 0xf3131891, 0x3dc7, 0x11d2, \
{ 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Label Alignments
*/
enum nsLabelAlignment {
eAlign_Right,
eAlign_Left,
eAlign_Center
};
struct nsLabelInitData : public nsWidgetInitData {
nsLabelInitData()
: mAlignment(eAlign_Left)
{
}
nsLabelAlignment mAlignment;
};
/**
* Label widget.
* Automatically shows itself as depressed when clicked on.
*/
class nsILabel : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILABEL_IID)
/**
* Set the label
*
* @param Set the label to aText
* @result NS_Ok if no errors
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result NS_Ok if no errors
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
/**
* Set the Label Alignemnt for creation
*
* @param aAlignment the alignment
* @result NS_Ok if no errors
*/
NS_IMETHOD SetAlignment(nsLabelAlignment aAlignment) = 0;
};
#endif

View File

@@ -1,183 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIListBox_h__
#define nsIListBox_h__
#include "nsIListWidget.h"
#include "nsString.h"
// {F8030014-C342-11d1-97F0-00609703C14E}
#define NS_ILISTBOX_IID \
{ 0xf8030014, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Initialize list box data
*/
struct nsListBoxInitData : public nsWidgetInitData {
nsListBoxInitData()
: mMultiSelect(PR_FALSE)
{
}
PRBool mMultiSelect;
};
/**
* Single or multi selection list of items.
* Unlike a nsIWidget, The the list widget must automatically clear
* itself to the background color when paint messages are generated.
* The listbox always has a vertical scrollbar. It never has a
* horizontal scrollbar.
*/
class nsIListBox : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILISTBOX_IID)
/**
* Set an item at the specific position
*
* @param aItem the item name. The item has to be null terminated
* @param aPosition the position the item should be inserted at
* 0 is at the top of the list
* -1 is at the end of the list
*/
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition) = 0;
/**
* Finds the first occurrence of the specified item
*
* @param aItem the string to be filled
* @param aStartPos the starting position (index)
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos) = 0;
/**
* Returns the number of items in the list
*
* @return the number of items
*
*/
virtual PRInt32 GetItemCount() = 0;
/**
* Remove the first occurrence of the specified item
*
* @param aPosition the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRBool RemoveItemAt(PRInt32 aPosition) = 0;
/**
* Gets an item at a specific location
*
* @param anItem on return contains the string of the item at that position
* @param aPosition the Position of the item
*
*/
virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition) = 0;
/**
* Gets the selected item for a single selection list
*
* @param aItem on return contains the string of the selected item
*
*/
NS_IMETHOD GetSelectedItem(nsString &aItem) = 0;
/**
* Returns with the index of the selected item
*
* @return PRInt32, index of selected item
*
*/
virtual PRInt32 GetSelectedIndex() = 0;
/**
* Select the item at the specified position
*
* @param PRInt32, the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
*/
NS_IMETHOD SelectItem(PRInt32 aPosition) = 0;
/**
* Deselects all the items in the list
*
*/
NS_IMETHOD Deselect() = 0;
/**
* Set the listbox to be multi-select.
* @param aMultiple PR_TRUE can have multiple selections. PR_FALSE single
* selections only.
* @return void
*
*/
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections) = 0;
/**
* Return the number of selected items. For single selection list box this
* @return the number of selected items
* can be 1 or 0.
*
*/
virtual PRInt32 GetSelectedCount() = 0;
/**
* Retrieves the indices of the selected items.
* @param aIndices Array to hold the selected items. Use GetSelectedCount to
* determine how large the array needs to be.
* @param aSize Size of the aIndices array
*
*/
NS_IMETHOD GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) = 0;
/**
* Sets the indices of the selected items.
* @param aIndices Array to hold the selected items. Use GetSelectedCount to
* determine how large the array needs to be.
* @param aSize Size of the aIndices array
*
*/
NS_IMETHOD SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) = 0;
};
#endif // nsIListBox_h__

View File

@@ -1,130 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIListWidget_h__
#define nsIListWidget_h__
#include "nsIWidget.h"
#include "nsString.h"
// {F8030013-C342-11d1-97F0-00609703C14E}
#define NS_ILISTWIDGET_IID \
{ 0xf8030013, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
*
* Base class for nsIListBox and nsIComboBox
*
*/
class nsIListWidget : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILISTWIDGET_IID)
/**
* Set an item at the specific position
*
* @param aItem the item name. The item has to be null terminated
* @param aPosition the position the item should be inserted at
* 0 is at the top of the list
* -1 is at the end of the list
*/
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition) = 0;
/**
* Finds the first occurrence of the specified item
*
* @param aItem the string to be filled
* @param aStartPos the starting position (index)
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos) = 0;
/**
* Returns the number of items in the list
*
* @return the number of items
*
*/
virtual PRInt32 GetItemCount() = 0;
/**
* Remove the first occurrence of the specified item
*
* @param aPosition the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
* @return PR_TRUE if successful, PR_FALSE otherwise
*
*/
virtual PRBool RemoveItemAt(PRInt32 aPosition) = 0;
/**
* Gets an item at a specific location
*
* @param anItem on return contains the string of the item at that position
* @param aPosition the Position of the item
*
*/
virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition) = 0;
/**
* Gets the selected item for a single selection list
*
* @param aItem on return contains the string of the selected item
*
*/
NS_IMETHOD GetSelectedItem(nsString &aItem) = 0;
/**
* Returns with the index of the selected item
*
* @return PRInt32, index of selected item
*
*/
virtual PRInt32 GetSelectedIndex() = 0;
/**
* Select the item at the specified position
*
* @param PRInt32, the item position
* 0 is at the top of the list
* -1 is at the end of the list
*
*/
NS_IMETHOD SelectItem(PRInt32 aPosition) = 0;
/**
* Deselects all the items in the list
*
*/
NS_IMETHOD Deselect() = 0;
};
#endif // nsIListWidget_h__

View File

@@ -1,161 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef __nsILookAndFeel
#define __nsILookAndFeel
#include "nsISupports.h"
#include "nsColor.h"
#include "nsFont.h"
#ifdef NS_DEBUG
#include "nsSize.h"
#endif
// {21B51DE1-21A3-11d2-B6E0-00805F8A2676}
#define NS_ILOOKANDFEEL_IID \
{ 0x21b51de1, 0x21a3, 0x11d2, \
{ 0xb6, 0xe0, 0x0, 0x80, 0x5f, 0x8a, 0x26, 0x76 } }
class nsILookAndFeel: public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILOOKANDFEEL_IID)
typedef enum {
eColor_WindowBackground,
eColor_WindowForeground,
eColor_WidgetBackground,
eColor_WidgetForeground,
eColor_WidgetSelectBackground,
eColor_WidgetSelectForeground,
eColor_Widget3DHighlight,
eColor_Widget3DShadow,
eColor_TextBackground,
eColor_TextForeground,
eColor_TextSelectBackground,
eColor_TextSelectForeground,
// New CSS 2 color definitions
eColor_activeborder,
eColor_activecaption,
eColor_appworkspace,
eColor_background,
eColor_buttonface,
eColor_buttonhighlight,
eColor_buttonshadow,
eColor_buttontext,
eColor_captiontext,
eColor_graytext,
eColor_highlight,
eColor_highlighttext,
eColor_inactiveborder,
eColor_inactivecaption,
eColor_inactivecaptiontext,
eColor_infobackground,
eColor_infotext,
eColor_menu,
eColor_menutext,
eColor_scrollbar,
eColor_threeddarkshadow,
eColor_threedface,
eColor_threedhighlight,
eColor_threedlightshadow,
eColor_threedshadow,
eColor_window,
eColor_windowframe,
eColor_windowtext
} nsColorID;
typedef enum {
eMetric_WindowTitleHeight,
eMetric_WindowBorderWidth,
eMetric_WindowBorderHeight,
eMetric_Widget3DBorder,
eMetric_TextFieldBorder, // Native border size
eMetric_TextFieldHeight,
eMetric_TextVerticalInsidePadding, // needed only because of GTK
eMetric_TextShouldUseVerticalInsidePadding, // needed only because of GTK
eMetric_TextHorizontalInsideMinimumPadding,
eMetric_TextShouldUseHorizontalInsideMinimumPadding, // needed only because of GTK
eMetric_ButtonHorizontalInsidePaddingNavQuirks,
eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks,
eMetric_CheckboxSize,
eMetric_RadioboxSize,
eMetric_ListShouldUseHorizontalInsideMinimumPadding, // needed only because of GTK
eMetric_ListHorizontalInsideMinimumPadding,
eMetric_ListShouldUseVerticalInsidePadding, // needed only because of GTK
eMetric_ListVerticalInsidePadding, // needed only because of GTK
eMetric_CaretBlinkTime, // default, may be overriden by OS
eMetric_CaretWidthTwips
} nsMetricID;
typedef enum {
eMetricFloat_TextFieldVerticalInsidePadding,
eMetricFloat_TextFieldHorizontalInsidePadding,
eMetricFloat_TextAreaVerticalInsidePadding,
eMetricFloat_TextAreaHorizontalInsidePadding,
eMetricFloat_ListVerticalInsidePadding,
eMetricFloat_ListHorizontalInsidePadding,
eMetricFloat_ButtonVerticalInsidePadding,
eMetricFloat_ButtonHorizontalInsidePadding
} nsMetricFloatID;
NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor) = 0;
NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric) = 0;
NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric) = 0;
#ifdef NS_DEBUG
typedef enum {
eMetricSize_TextField = 0,
eMetricSize_TextArea = 1,
eMetricSize_ListBox = 2,
eMetricSize_ComboBox = 3,
eMetricSize_Radio = 4,
eMetricSize_CheckBox = 5,
eMetricSize_Button = 6
} nsMetricNavWidgetID;
typedef enum {
eMetricSize_Courier = 0,
eMetricSize_SansSerif = 1
} nsMetricNavFontID;
// This method returns the actual (or nearest estimate)
// of the Navigator size for a given form control for a given font
// and font size. This is used in NavQuirks mode to see how closely
// we match its size
NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
const nsMetricNavFontID aFontID,
const PRInt32 aFontSize,
nsSize &aSize) = 0;
#endif
};
#define nsLAF nsILookAndFeel
#endif /* __nsILookAndFeel */

View File

@@ -1,190 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIMenu_h__
#define nsIMenu_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIWebShell.h"
class nsIMenuBar;
class nsIMenu;
class nsIMenuItem;
class nsIMenuListener;
// {35A3DEC1-4992-11d2-8DBA-00609703C14E}
#define NS_IMENU_IID \
{ 0x35a3dec1, 0x4992, 0x11d2, \
{ 0x8d, 0xba, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Menu widget
*/
class nsIMenu : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMENU_IID)
/**
* Creates the Menu
*
*/
NS_IMETHOD Create(nsISupports * aParent, const nsString &aLabel) = 0;
/**
* Get the Menu's Parent
*
*/
NS_IMETHOD GetParent(nsISupports *&aParent) = 0;
/**
* Get the Menu label
*
*/
NS_IMETHOD GetLabel(nsString &aText) = 0;
/**
* Set the Menu label
*
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the Menu Access Key
*
*/
NS_IMETHOD GetAccessKey(nsString &aText) = 0;
/**
* Set the Menu Access Key
*
*/
NS_IMETHOD SetAccessKey(const nsString &aText) = 0;
/**
* Set the Menu enabled state
*
*/
NS_IMETHOD SetEnabled(PRBool aIsEnabled) = 0;
/**
* Get the Menu enabled state
*
*/
NS_IMETHOD GetEnabled(PRBool* aIsEnabled) = 0;
/**
* Query if this is the help menu. Mostly for MacOS voodoo.
*
*/
NS_IMETHOD IsHelpMenu(PRBool* aIsHelpMenu) = 0;
/**
* Adds a Menu Item
*
*/
NS_IMETHOD AddItem(nsISupports* aItem) = 0;
/**
* Adds a separator
*
*/
NS_IMETHOD AddSeparator() = 0;
/**
* Returns the number of menu items
* This does count separators as items
*/
NS_IMETHOD GetItemCount(PRUint32 &aCount) = 0;
/**
* Returns a Menu or Menu Item at a specified Index
*
*/
NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem) = 0;
/**
* Inserts a Menu Item at a specified Index
*
*/
NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem) = 0;
/**
* Removes an Menu Item from a specified Index
*
*/
NS_IMETHOD RemoveItem(const PRUint32 aPos) = 0;
/**
* Removes all the Menu Items
*
*/
NS_IMETHOD RemoveAll() = 0;
/**
* Gets Native MenuHandle
*
*/
NS_IMETHOD GetNativeData(void** aData) = 0;
/**
* Sets Native MenuHandle
*
*/
NS_IMETHOD SetNativeData(void* aData) = 0;
/**
* Adds menu listener for dynamic construction
*
*/
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Removes menu listener for dynamic construction
*
*/
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Set DOMNode
*
*/
NS_IMETHOD SetDOMNode(nsIDOMNode * aMenuNode) = 0;
/**
* Set DOMElement
*
*/
NS_IMETHOD SetDOMElement(nsIDOMElement * aMenuElement) = 0;
/**
* Set WebShell
*
*/
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell) = 0;
};
#endif

View File

@@ -1,120 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIMenuBar_h__
#define nsIMenuBar_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIMenu.h"
#include "nsIWebShell.h"
class nsIWidget;
// {BC658C81-4BEB-11d2-8DBB-00609703C14E}
#define NS_IMENUBAR_IID \
{ 0xbc658c81, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* MenuBar widget
*/
class nsIMenuBar : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMENUBAR_IID)
/**
* Creates the MenuBar
*
*/
NS_IMETHOD Create(nsIWidget * aParent) = 0;
/**
* Get the MenuBar's Parent
*
*/
NS_IMETHOD GetParent(nsIWidget *&aParent) = 0;
/**
* Set the MenuBar's Parent
*
*/
NS_IMETHOD SetParent(nsIWidget *aParent) = 0;
/**
* Adds the Menu
*
*/
NS_IMETHOD AddMenu(nsIMenu * aMenu) = 0;
/**
* Returns the number of menus
*
*/
NS_IMETHOD GetMenuCount(PRUint32 &aCount) = 0;
/**
* Returns a Menu Item at a specified Index
*
*/
NS_IMETHOD GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu) = 0;
/**
* Inserts a Menu at a specified Index
*
*/
NS_IMETHOD InsertMenuAt(const PRUint32 aCount, nsIMenu *& aMenu) = 0;
/**
* Removes an Menu from a specified Index
*
*/
NS_IMETHOD RemoveMenu(const PRUint32 aCount) = 0;
/**
* Removes all the Menus
*
*/
NS_IMETHOD RemoveAll() = 0;
/**
* Gets Native MenuHandle
*
*/
NS_IMETHOD GetNativeData(void*& aData) = 0;
/**
* Sets Native MenuHandle. Temporary hack for mac until
* nsMenuBar does it's own construction
*/
NS_IMETHOD SetNativeData(void* aData) = 0;
/**
* Draw the menubar
*
*/
NS_IMETHOD Paint() = 0;
};
#endif

View File

@@ -1,189 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIMenuItem_h__
#define nsIMenuItem_h__
#include "prtypes.h"
#include "nsISupports.h"
#include "nsString.h"
#include "nsIWebShell.h"
#include "nsIDOMElement.h"
// {7F045771-4BEB-11d2-8DBB-00609703C14E}
#define NS_IMENUITEM_IID \
{ 0x7f045771, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
class nsIMenu;
class nsIPopUpMenu;
class nsIWidget;
class nsIMenuListener;
enum {
knsMenuItemNoModifier = 0,
knsMenuItemShiftModifier = (1 << 0),
knsMenuItemAltModifier = (1 << 1),
knsMenuItemControlModifier = (1 << 2),
knsMenuItemCommandModifier = (1 << 3)
};
/**
* MenuItem widget
*/
class nsIMenuItem : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMENUITEM_IID)
/**
* Creates the MenuItem
*
*/
NS_IMETHOD Create(nsISupports * aParent,
const nsString & aLabel,
PRBool isSeparator) = 0;
/**
* Get the MenuItem label
*
*/
NS_IMETHOD GetLabel(nsString &aText) = 0;
/**
* Get the MenuItem label
*
*/
NS_IMETHOD SetLabel(nsString &aText) = 0;
/**
* Set the Menu shortcut char
*
*/
NS_IMETHOD SetShortcutChar(const nsString &aText) = 0;
/**
* Get the Menu shortcut char
*
*/
NS_IMETHOD GetShortcutChar(nsString &aText) = 0;
/**
* Sets whether the item is enabled or disabled
*
*/
NS_IMETHOD SetEnabled(PRBool aIsEnabled) = 0;
/**
* Gets whether the item is enabled or disabled
*
*/
NS_IMETHOD GetEnabled(PRBool *aIsEnabled) = 0;
/**
* Sets whether the item is checked or not
*
*/
NS_IMETHOD SetChecked(PRBool aIsEnabled) = 0;
/**
* Gets whether the item is checked or not
*
*/
NS_IMETHOD GetChecked(PRBool *aIsEnabled) = 0;
/**
* Sets whether the item is a checkbox type
*
*/
NS_IMETHOD SetCheckboxType(PRBool aIsCheckbox) = 0;
/**
* Gets whether the item is a checkbox type
*
*/
NS_IMETHOD GetCheckboxType(PRBool *aIsCheckbox) = 0;
/**
* Gets the MenuItem Command identifier
*
*/
NS_IMETHOD GetCommand(PRUint32 & aCommand) = 0;
/**
* Gets the target for MenuItem
*
*/
NS_IMETHOD GetTarget(nsIWidget *& aTarget) = 0;
/**
* Gets Native Menu Handle
*
*/
NS_IMETHOD GetNativeData(void*& aData) = 0;
/**
* Adds menu listener
*
*/
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Removes menu listener
*
*/
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener) = 0;
/**
* Indicates whether it is a separator
*
*/
NS_IMETHOD IsSeparator(PRBool & aIsSep) = 0;
/**
* Sets the JavaScript Command to be invoked when a "gui" event occurs on a source widget
* @param aStrCmd the JS command to be cached for later execution
* @return NS_OK
*/
NS_IMETHOD SetCommand(const nsString & aStrCmd) = 0;
/**
* Executes the "cached" JavaScript Command
* @return NS_OK if the command was executed properly, otherwise an error code
*/
NS_IMETHOD DoCommand() = 0;
NS_IMETHOD SetDOMNode(nsIDOMNode * aDOMNode) = 0;
NS_IMETHOD GetDOMNode(nsIDOMNode ** aDOMNode) = 0;
NS_IMETHOD SetDOMElement(nsIDOMElement * aDOMElement) = 0;
NS_IMETHOD GetDOMElement(nsIDOMElement ** aDOMElement) = 0;
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell) = 0;
/**
*
*/
NS_IMETHOD SetModifiers(PRUint8 aModifiers) = 0;
NS_IMETHOD GetModifiers(PRUint8 * aModifiers) = 0;
};
#endif

View File

@@ -1,85 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIMenuListener_h__
#define nsIMenuListener_h__
#include "nsGUIEvent.h"
#include "nsISupports.h"
// TODO: This needs to be generated!
// {BC658C81-4BEB-11d2-8DBB-00609703C14E}
#define NS_IMENULISTENER_IID \
{ 0xbc658c81, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x9e } }
static NS_DEFINE_IID(kIMenuListenerIID, NS_IMENULISTENER_IID);
/**
*
* Menu event listener
* This interface should only be implemented by the menu manager
* These are registered with nsWindows to recieve menu events
*/
class nsIMenuListener : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMENULISTENER_IID)
/**
* Processes a menu item selected event
* @param aMenuEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent) = 0;
/**
* Processes a menu selected event
* @param aMenuEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent) = 0;
/**
* Processes a menu deselect event
* @param aMenuEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent) = 0;
virtual nsEventStatus MenuConstruct(
const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell) = 0;
virtual nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent) = 0;
};
#endif // nsIMenuListener_h__

View File

@@ -1,75 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIMouseListener_h__
#define nsIMouseListener_h__
#include "nsGUIEvent.h"
#include "nsISupports.h"
/**
*
* Mouse up/down/move event listener
*
*/
// {c83f6b81-d7ce-11d2-8360-c4c894c4917c}
#define NS_IMOUSELISTENER_IID \
{ 0xc83f6b81, 0xd7ce, 0x11d2, { 0x83, 0x60, 0xc4, 0xc8, 0x94, 0xc4, 0x91, 0x7c } }
class nsIMouseListener : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMOUSELISTENER_IID)
/**
* Processes a mouse pressed event
* @param aMouseEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MousePressed(const nsGUIEvent & aMouseEvent) = 0;
/**
* Processes a mouse release event
* @param aMouseEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MouseReleased(const nsGUIEvent & aMouseEvent) = 0;
/**
* Processes a mouse clicked event
* @param aMouseEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*
*/
virtual nsEventStatus MouseClicked(const nsGUIEvent & aMouseEvent) = 0;
/**
* Processes a mouse moved event
* @param aMouseEvent See nsGUIEvent.h
* @return whether the event was consumed or ignored. See nsEventStatus
*/
virtual nsEventStatus MouseMoved(const nsGUIEvent & aMouseEvent) = 0;
};
#endif // nsIMouseListener_h__

View File

@@ -1,138 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIPopUpMenu_h__
#define nsIPopUpMenu_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIMenuItem.h"
class nsIMenu;
class nsIWidget;
// {F6CD4F21-53AF-11d2-8DC4-00609703C14E}
#define NS_IPOPUPMENU_IID \
{ 0xf6cd4f21, 0x53af, 0x11d2, \
{ 0x8d, 0xc4, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* PopUpMenu widget
*/
class nsIPopUpMenu : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPOPUPMENU_IID)
/**
* Creates the PopUpMenu
*
*/
NS_IMETHOD Create(nsIWidget * aParent) = 0;
/**
* Adds a PopUpMenu Item
*
*/
NS_IMETHOD AddItem(const nsString &aText) = 0;
/**
* Adds a PopUpMenu Item
*
*/
NS_IMETHOD AddItem(nsIMenuItem * aMenuItem) = 0;
/**
* Adds a Cascading PopUpMenu
*
*/
NS_IMETHOD AddMenu(nsIMenu * aMenu) = 0;
/**
* Adds Separator
*
*/
NS_IMETHOD AddSeparator() = 0;
/**
* Returns the number of menu items
*
*/
NS_IMETHOD GetItemCount(PRUint32 &aCount) = 0;
/**
* Returns a PopUpMenu Item at a specified Index
*
*/
NS_IMETHOD GetItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem) = 0;
/**
* Inserts a PopUpMenu Item at a specified Index
*
*/
NS_IMETHOD InsertItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem) = 0;
/**
* Creates and inserts a PopUpMenu Item at a specified Index
*
*/
NS_IMETHOD InsertItemAt(const PRUint32 aCount, const nsString & aMenuItemName) = 0;
/**
* Creates and inserts a Separator at a specified Index
*
*/
NS_IMETHOD InsertSeparator(const PRUint32 aCount) = 0;
/**
* Removes an PopUpMenu Item from a specified Index
*
*/
NS_IMETHOD RemoveItem(const PRUint32 aCount) = 0;
/**
* Removes all the PopUpMenu Items
*
*/
NS_IMETHOD RemoveAll() = 0;
/**
* Shows menu and waits for action
*
*/
NS_IMETHOD ShowMenu(PRInt32 aX, PRInt32 aY) = 0;
/**
* Gets Native MenuHandle
*
*/
NS_IMETHOD GetNativeData(void*& aData) = 0;
/**
* Gets parent widget
*
*/
NS_IMETHOD GetParent(nsIWidget *& aParent) = 0;
};
#endif

View File

@@ -1,80 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIRadioButton_h__
#define nsIRadioButton_h__
#include "nsIButton.h"
#define NS_IRADIOBUTTON_IID \
{ 0x18032ad4, 0xb265, 0x11d2, \
{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
* RadioButton widget. Can show itself in a checked or unchecked state.
* The RadioButton widget automatically shows itself checked or unchecked when clicked on.
*/
class nsIRadioButton : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRADIOBUTTON_IID)
/**
* Set the button label
*
* @param aText button label
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
/**
* Set the check state.
* @param aState PR_TRUE show as checked. PR_FALSE show unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetState(const PRBool aState) = 0;
/**
* Get the check state.
* @param aState PR_TRUE if checked. PR_FALSE if unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetState(PRBool& aState) = 0;
};
#endif // nsIRadioButton_h__

View File

@@ -1,35 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Rod Spears <rods@netscape.com>
* Stuart Parmenter <pavlov@netscape.com>
*/
#include "nsISupports.idl"
[uuid(23C2BA03-6C76-11d3-96ED-0060B0FB9956)]
interface nsIRollupListener : nsISupports
{
/**
* Notifies the object to rollup
* @result NS_Ok if no errors
*/
void Rollup();
};

View File

@@ -1,124 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIScrollbar_h__
#define nsIScrollbar_h__
#include "nsIWidget.h"
// {18032AD2-B265-11d1-AA2A-000000000000}
#define NS_ISCROLLBAR_IID \
{ 0x18032ad2, 0xb265, 0x11d1, \
{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
*
* Scrollbar, converts mouse input into values that can be used
* to shift the contents of a window.
*
*/
class nsIScrollbar : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCROLLBAR_IID)
/**
* Set the scrollbar range
* @param aEndRange set range for scrollbar from 0 to aEndRange
* @result NS_Ok if no errors
*
*/
NS_IMETHOD SetMaxRange(PRUint32 aEndRange) = 0;
/**
* Get the scrollbar range
* @return the upper end of the scrollbar range
* @result NS_Ok if no errors
*/
NS_IMETHOD GetMaxRange(PRUint32& aMaxRange) = 0;
/**
* Set the thumb position.
* @param aPos a value between (startRange) and (endRange - thumbSize)
* @result NS_Ok if no errors
*
*/
NS_IMETHOD SetPosition(PRUint32 aPos) = 0;
/**
* Get the thumb position.
* @return a value between (startRange) and (endRange - thumbSize)
* @result NS_Ok if no errors
*
*/
NS_IMETHOD GetPosition(PRUint32& aPos) = 0;
/**
* Set the thumb size.
* @param aSize size of the thumb. Must be a value between
* startRange and endRange
* @result NS_Ok if no errors
*/
NS_IMETHOD SetThumbSize(PRUint32 aSize) = 0;
/**
* Get the thumb size.
* @return size of the thumb. The value is between
* startRange and endRange
* @result NS_Ok if no errors
*/
NS_IMETHOD GetThumbSize(PRUint32& aSize) = 0;
/**
* Set the line increment.
* @param aSize size of the line increment. The value must
* be between startRange and endRange
* @result NS_Ok if no errors
*/
NS_IMETHOD SetLineIncrement(PRUint32 aSize) = 0;
/**
* Get the line increment.
* @return size of the line increment. The value is
* between startRange and endRange
* @result NS_Ok if no errors
*/
NS_IMETHOD GetLineIncrement(PRUint32& aSize) = 0;
/**
* Set all scrollbar parameters at once
* @param aMaxRange set range for scrollbar from 0 to aMaxRange
* @param aThumbSize size of the thumb. Must be a value between
* startRange and endRange
* @param aPosition a value between (startRange) and (endRange - thumbSize)
* @param aLineIncrement size of the line increment. The value must
* be between startRange and endRange
* @result NS_Ok if no errors
*/
NS_IMETHOD SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize,
PRUint32 aPosition, PRUint32 aLineIncrement) = 0;
};
#endif // nsIScrollbar_h__

View File

@@ -1,43 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsIFileSpec.idl"
[scriptable, uuid(B148EED1-236D-11d3-B35C-00A0CC3C1CDE)]
interface nsISound : nsISupports
{
void Init();
void Play(in nsIFileSpec filespec);
// void Stop();
void Beep();
};
%{ C++
extern nsresult
NS_NewSound(nsISound** aSound);
%}

View File

@@ -1,158 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsITextAreaWidget_h__
#define nsITextAreaWidget_h__
#include "nsIWidget.h"
#include "nsITextWidget.h"
#include "nsString.h"
// {F8030012-C342-11d1-97F0-00609703C14E}
#define NS_ITEXTAREAWIDGET_IID \
{ 0xf8030012, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Multi-line text editor.
* See nsITextWidget for capabilities.
* Displays a scrollbar when the text content exceeds the number of lines
* displayed.
* Unlike a nsIWidget, The textarea must automatically clear
* itself to the background color when paint messages are generated.
*/
class nsITextAreaWidget : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTAREAWIDGET_IID)
/**
* Get the text of this component.
*
* @param aTextBuffer on return contains the text of this component
* @param aBufferSize the size of the buffer passed in
* @param aActualSize the number of char copied
* @result NS_Ok if no errors
*
*/
NS_IMETHOD GetText(nsString &aTextBuffer, PRUint32 aBufferSize, PRUint32& aActualSize) = 0;
/**
* Set the text of this component.
*
* @param aText -- an object containing a copy of the text
* @return the number of chars in the text string
* @result NS_Ok if no errors
*
*/
NS_IMETHOD SetText(const nsString &aText, PRUint32& aActualSize) = 0;
/**
* Insert text into this component.
* When aStartPos and aEndPos are a valid range this function performs a replace.
* When aStartPos and aEndPos are equal this function performs an insert.
* When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append.
* If aStartPos and aEndPos are out of range they are rounded to the closest end.
*
* @param aText the text to set
* @param aStartPos starting position for inserting text
* @param aEndPos ending position for inserting text
* @result NS_Ok if no errors
*/
NS_IMETHOD InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32& aActualSize) = 0;
/**
* Remove any content from this text widget
* @result NS_Ok if no errors
*/
NS_IMETHOD RemoveText(void) = 0;
/**
* Sets the maximum number of characters the widget can hold
*
* @param aChars maximum number of characters for this widget. if 0 then there isn't any limit
* @result NS_Ok if no errors
*/
NS_IMETHOD SetMaxTextLength(PRUint32 aChars) = 0;
/**
* Set the text widget to be read-only
*
* @param aReadOnlyFlag PR_TRUE the widget is read-only,
* PR_FALSE indicates the widget is writable.
* @param PR_TRUE if it was read only. PR_FALSE if it was writable
* @result NS_Ok if no errors
*/
NS_IMETHOD SetReadOnly(PRBool aNewReadOnlyFlag, PRBool& aOldReadOnlyFlag) = 0;
/**
* Select all of the contents
* @result NS_Ok if no errors
*/
NS_IMETHOD SelectAll() = 0;
/**
* Set the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) = 0;
/**
* Get the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) = 0;
/**
* Set the caret position
* @param aPosition caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetCaretPosition(PRUint32 aPosition) = 0;
/**
* Get the caret position
* @return caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetCaretPosition(PRUint32& aPosition) = 0;
};
#endif // nsITextAreaWidget_h__

View File

@@ -1,179 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsITextWidget_h__
#define nsITextWidget_h__
#include "nsIWidget.h"
#include "nsString.h"
// {F8030011-C342-11d1-97F0-00609703C14E}
#define NS_ITEXTWIDGET_IID \
{ 0xf8030011, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
struct nsTextWidgetInitData : public nsWidgetInitData {
nsTextWidgetInitData()
: mIsPassword(PR_FALSE),
mIsReadOnly(PR_FALSE)
{
}
PRBool mIsPassword;
PRBool mIsReadOnly;
};
/**
*
* Single line text editor.
* Unlike a nsIWidget, The text editor must automatically clear
* itself to the background color when paint messages are generated.
*
*/
class nsITextWidget : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTWIDGET_IID)
/**
* Get the text of this component.
*
* @param aTextBuffer on return contains the text of this component
* @param aBufferSize the size of the buffer passed in
* @param aActualSize the number of char copied
* @result NS_Ok if no errors
*
*/
NS_IMETHOD GetText(nsString &aTextBuffer, PRUint32 aBufferSize, PRUint32& aActualSize) = 0;
/**
* Set the text of this component.
*
* @param aText -- an object containing a copy of the text
* @return the number of chars in the text string
* @result NS_Ok if no errors
*
*/
NS_IMETHOD SetText(const nsString &aText, PRUint32& aActualSize) = 0;
/**
* Insert text into this component.
* When aStartPos and aEndPos are a valid range this function performs a replace.
* When aStartPos and aEndPos are equal this function performs an insert.
* When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append.
* If aStartPos and aEndPos are out of range they are rounded to the closest end.
*
* @param aText the text to set
* @param aStartPos starting position for inserting text
* @param aEndPos ending position for inserting text
* @result NS_Ok if no errors
*/
NS_IMETHOD InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32& aActualSize) = 0;
/**
* Remove any content from this text widget
* @result NS_Ok if no errors
*/
NS_IMETHOD RemoveText(void) = 0;
/**
* Indicates a password will be entered.
*
* @param aIsPassword PR_TRUE shows contents as asterisks. PR_FALSE shows
* contents as normal text.
* @result NS_Ok if no errors
*/
NS_IMETHOD SetPassword(PRBool aIsPassword) = 0;
/**
* Sets the maximum number of characters the widget can hold
*
* @param aChars maximum number of characters for this widget. if 0 then there isn't any limit
* @result NS_Ok if no errors
*/
NS_IMETHOD SetMaxTextLength(PRUint32 aChars) = 0;
/**
* Set the text widget to be read-only
*
* @param aReadOnlyFlag PR_TRUE the widget is read-only,
* PR_FALSE indicates the widget is writable.
* @param PR_TRUE if it was read only. PR_FALSE if it was writable
* @result NS_Ok if no errors
*/
NS_IMETHOD SetReadOnly(PRBool aNewReadOnlyFlag, PRBool& aOldReadOnlyFlag) = 0;
/**
* Select all of the contents
* @result NS_Ok if no errors
*/
NS_IMETHOD SelectAll() = 0;
/**
* Set the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) = 0;
/**
* Get the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) = 0;
/**
* Set the caret position
* @param aPosition caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetCaretPosition(PRUint32 aPosition) = 0;
/**
* Get the caret position
* @return caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetCaretPosition(PRUint32& aPosition) = 0;
};
#endif // nsITextWidget_h__

View File

@@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#include "nsISupports.idl"
%{ C++
#include "prthread.h"
%}
[ptr] native PRThread(PRThread);
[uuid(18032BD0-B265-11d1-AA2A-000000000000)]
interface nsIToolkit : nsISupports
{
/**
* Initialize this toolkit with aThread.
* @param aThread The thread passed in runs the message pump.
* NULL can be passed in, in which case a new thread gets created
* and a message pump will run in that thread
*
*/
void Init(in PRThread aThread);
};
%{ C++
extern NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult);
%}

View File

@@ -1,123 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
* Communications Corp. All Rights Reserved.
*
* Contributor(s):
* Mike Pinkerton
*/
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsIFormatConverter.idl"
%{ C++
// these probably shouldn't live here, but in some central repository shared
// by the entire app.
#define kTextMime "text/plain"
#define kXIFMime "text/xif"
#define kUnicodeMime "text/unicode"
#define kHTMLMime "text/html"
#define kAOLMailMime "AOLMAIL"
#define kPNGImageMime "image/png"
#define kJPEGImageMime "image/jpg"
#define kGIFImageMime "image/gif"
#define kDropFilesMime "text/dropfiles"
%}
[scriptable, uuid(8B5314BC-DB01-11d2-96CE-0060B0FB9956)]
interface nsITransferable : nsISupports
{
/**
* Computes a list of flavors (mime types as nsISupportsString) that the transferable
* can export, either through intrinsic knowledge or output data converters.
*
* @param aDataFlavorList fills list with supported flavors. This is a copy of
* the internal list, so it may be edited w/out affecting the transferable.
*/
nsISupportsArray flavorsTransferableCanExport ( ) ;
/**
* Given a flavor retrieve the data.
*
* @param aFlavor (in parameter) the flavor of data to retrieve
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
* @param aDataLen the length of the data
*/
void getTransferData ( in string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
/**
* Returns the best flavor in the transferable, given those that have
* been added to it with |AddFlavor()|
*
* @param aFlavor (out parameter) the flavor of data that was retrieved
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
* @param aDataLen the length of the data
*/
void getAnyTransferData ( out string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
/**
* Returns true if the data is large.
*/
boolean isLargeDataSet ( ) ;
///////////////////////////////
// Setter part of interface
///////////////////////////////
/**
* Computes a list of flavors (mime types as nsISupportsString) that the transferable can
* accept into it, either through intrinsic knowledge or input data converters.
*
* @param outFlavorList fills list with supported flavors. This is a copy of
* the internal list, so it may be edited w/out affecting the transferable.
*/
nsISupportsArray flavorsTransferableCanImport ( ) ;
/**
* Sets the data in the transferable with the specified flavor. The transferable
* will maintain its own copy the data, so it is not necessary to do that beforehand.
*
* @param aFlavor the flavor of data that is being set
* @param aData the data, some variant of class in nsISupportsPrimitives.idl
* @param aDataLen the length of the data
*/
void setTransferData ( in string aFlavor, in nsISupports aData, in unsigned long aDataLen ) ;
/**
* Add the data flavor, indicating that this transferable
* can receive this type of flavor
*
* @param aDataFlavor a new data flavor to handle
*/
void addDataFlavor ( in string aDataFlavor ) ;
/**
* Removes the data flavor matching the given one (string compare) and the data
* that goes along with it.
*
* @param aDataFlavor a data flavor to remove
*/
void removeDataFlavor ( in string aDataFlavor ) ;
attribute nsIFormatConverter converter;
};

View File

@@ -1,725 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIWidget_h__
#define nsIWidget_h__
#include "nsISupports.h"
#include "nsColor.h"
#include "nsIMouseListener.h"
#include "nsIMenuListener.h"
#include "nsIImage.h"
#include "prthread.h"
#include "nsGUIEvent.h"
// forward declarations
class nsIAppShell;
class nsIToolkit;
class nsIFontMetrics;
class nsIToolkit;
class nsIRenderingContext;
class nsIEnumerator;
class nsIDeviceContext;
struct nsRect;
struct nsFont;
class nsIMenuBar;
class nsIEventListener;
class nsIRollupListener;
/**
* Callback function that processes events.
* The argument is actually a subtype (subclass) of nsEvent which carries
* platform specific information about the event. Platform specific code knows
* how to deal with it.
* The return value determines whether or not the default action should take place.
*/
typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event);
/**
* Flags for the getNativeData function.
* See getNativeData()
*/
#define NS_NATIVE_WINDOW 0
#define NS_NATIVE_GRAPHIC 1
#define NS_NATIVE_COLORMAP 2
#define NS_NATIVE_WIDGET 3
#define NS_NATIVE_DISPLAY 4
#define NS_NATIVE_REGION 5
#define NS_NATIVE_OFFSETX 6
#define NS_NATIVE_OFFSETY 7
#define NS_NATIVE_PLUGIN_PORT 8
#define NS_NATIVE_SCREEN 9
// {18032AD5-B265-11d1-AA2A-000000000000}
#define NS_IWIDGET_IID \
{ 0x18032ad5, 0xb265, 0x11d1, \
{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
// Hide the native window systems real window type so as to avoid
// including native window system types and api's. This is necessary
// to ensure cross-platform code.
typedef void* nsNativeWidget;
/**
* Border styles
*/
enum nsWindowType {
// default top level window
eWindowType_toplevel,
// top level window but usually handled differently by the OS
eWindowType_dialog,
// used for combo boxes, etc
eWindowType_popup,
// child windows (contained inside a window on the desktop (has no border))
eWindowType_child
};
enum nsBorderStyle
{
// no border, titlebar, etc.. opposite of all
eBorderStyle_none = 0,
// all window decorations
eBorderStyle_all = 1 << 0,
// enables the border on the window. these are only for decoration and are not resize hadles
eBorderStyle_border = 1 << 1,
// enables the resize handles for the window. if this is set, border is implied to also be set
eBorderStyle_resizeh = 1 << 2,
// enables the titlebar for the window
eBorderStyle_title = 1 << 3,
// enables the window menu button on the title bar. this being on should force the title bar to display
eBorderStyle_menu = 1 << 4,
// enables the minimize button so the user can minimize the window.
// turned off for tranient windows since they can not be minimized seperate from their parent
eBorderStyle_minimize = 1 << 5,
// enables the maxmize button so the user can maximize the window
eBorderStyle_maximize = 1 << 6,
// show the close button
eBorderStyle_close = 1 << 7,
// whatever the OS wants... i.e. don't do anything
eBorderStyle_default = -1
};
/**
* Cursor types.
*/
enum nsCursor { ///(normal cursor, usually rendered as an arrow)
eCursor_standard,
///(system is busy, usually rendered as a hourglass or watch)
eCursor_wait,
///(Selecting something, usually rendered as an IBeam)
eCursor_select,
///(can hyper-link, usually rendered as a human hand)
eCursor_hyperlink,
///(west/east sizing, usually rendered as ->||<-)
eCursor_sizeWE,
///(north/south sizing, usually rendered as sizeWE rotated 90 degrees)
eCursor_sizeNS,
eCursor_arrow_north,
eCursor_arrow_north_plus,
eCursor_arrow_south,
eCursor_arrow_south_plus,
eCursor_arrow_west,
eCursor_arrow_west_plus,
eCursor_arrow_east,
eCursor_arrow_east_plus,
eCursor_crosshair,
//Don't know what 'move' cursor should be. See CSS2.
eCursor_move,
eCursor_help
};
/**
* Basic struct for widget initialization data.
* @see Create member function of nsIWidget
*/
struct nsWidgetInitData {
nsWidgetInitData()
: clipChildren(PR_FALSE), clipSiblings(PR_FALSE),
mWindowType(eWindowType_child),
mBorderStyle(eBorderStyle_default)
{
}
// when painting exclude area occupied by child windows and sibling windows
PRPackedBool clipChildren, clipSiblings;
nsWindowType mWindowType;
nsBorderStyle mBorderStyle;
};
/**
* The base class for all the widgets. It provides the interface for
* all basic and necessary functionality.
*/
class nsIWidget : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWIDGET_IID)
/**
* Create and initialize a widget.
*
* The widget represents a window that can be drawn into. It also is the
* base class for user-interface widgets such as buttons and text boxes.
*
* All the arguments can be NULL in which case a top level window
* with size 0 is created. The event callback function has to be
* provided only if the caller wants to deal with the events this
* widget receives. The event callback is basically a preprocess
* hook called synchronously. The return value determines whether
* the event goes to the default window procedure or it is hidden
* to the os. The assumption is that if the event handler returns
* false the widget does not see the event. The widget should not
* automatically clear the window to the background color. The
* calling code must handle paint messages and clear the background
* itself.
*
* @param parent or null if it's a top level window
* @param aRect the widget dimension
* @param aHandleEventFunction the event handler callback function
* @param aContext
* @param aAppShell the parent application shell. If nsnull,
* the parent window's application shell will be used.
* @param aToolkit
* @param aInitData data that is used for widget initialization
*
*/
NS_IMETHOD Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0;
/**
* Create and initialize a widget with a native window parent
*
* The widget represents a window that can be drawn into. It also is the
* base class for user-interface widgets such as buttons and text boxes.
*
* All the arguments can be NULL in which case a top level window
* with size 0 is created. The event callback function has to be
* provided only if the caller wants to deal with the events this
* widget receives. The event callback is basically a preprocess
* hook called synchronously. The return value determines whether
* the event goes to the default window procedure or it is hidden
* to the os. The assumption is that if the event handler returns
* false the widget does not see the event.
*
* @param aParent native window.
* @param aRect the widget dimension
* @param aHandleEventFunction the event handler callback function
*/
NS_IMETHOD Create(nsNativeWidget aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0;
/**
* Accessor functions to get and set the client data associated with the
* widget.
*/
//@{
NS_IMETHOD GetClientData(void*& aClientData) = 0;
NS_IMETHOD SetClientData(void* aClientData) = 0;
//@}
/**
* Close and destroy the internal native window.
* This method does not delete the widget.
*/
NS_IMETHOD Destroy(void) = 0;
/**
* Return the parent Widget of this Widget or nsnull if this is a
* top level window
*
* @return the parent widget or nsnull if it does not have a parent
*
*/
virtual nsIWidget* GetParent(void) = 0;
/**
* Return an nsEnumerator over the children of this widget.
*
* @return an enumerator over the list of children or nsnull if it does not
* have any children
*
*/
virtual nsIEnumerator* GetChildren(void) = 0;
/**
* Show or hide this widget
*
* @param aState PR_TRUE to show the Widget, PR_FALSE to hide it
*
*/
NS_IMETHOD Show(PRBool aState) = 0;
/**
* Make the window modal
*
*/
NS_IMETHOD SetModal(PRBool aModal) = 0;
/**
* Returns whether the window is visible
*
*/
NS_IMETHOD IsVisible(PRBool & aState) = 0;
/**
* Move this widget.
*
* @param aX the new x position expressed in the parent's coordinate system
* @param aY the new y position expressed in the parent's coordinate system
*
**/
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY) = 0;
/**
* Resize this widget.
*
* @param aWidth the new width expressed in the parent's coordinate system
* @param aHeight the new height expressed in the parent's coordinate system
* @param aRepaint whether the widget should be repainted
*
*/
NS_IMETHOD Resize(PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint) = 0;
/**
* Move or resize this widget.
*
* @param aX the new x position expressed in the parent's coordinate system
* @param aY the new y position expressed in the parent's coordinate system
* @param aWidth the new width expressed in the parent's coordinate system
* @param aHeight the new height expressed in the parent's coordinate system
* @param aRepaint whether the widget should be repainted if the size changes
*
*/
NS_IMETHOD Resize(PRInt32 aX,
PRInt32 aY,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint) = 0;
/**
* Set's the widget's z-index.
*/
NS_IMETHOD SetZIndex(PRInt32 aZIndex) = 0;
/**
* Get's the widget's z-index.
*/
NS_IMETHOD GetZIndex(PRInt32* aZIndex) = 0;
/**
* Enable or disable this Widget
*
* @param aState PR_TRUE to enable the Widget, PR_FALSE to disable it.
*
*/
NS_IMETHOD Enable(PRBool aState) = 0;
/**
* Give focus to this widget.
*/
NS_IMETHOD SetFocus(void) = 0;
/**
* Get this widget's outside dimensions relative to it's parent widget
*
* @param aRect on return it holds the x. y, width and height of this widget
*
*/
NS_IMETHOD GetBounds(nsRect &aRect) = 0;
/**
* Get this widget's client area dimensions, if the window has a 3D border appearance
* this returns the area inside the border, The x and y are always zero
*
* @param aRect on return it holds the x. y, width and height of the client area of this widget
*
*/
NS_IMETHOD GetClientBounds(nsRect &aRect) = 0;
/**
* Gets the width and height of the borders
* @param aWidth the width of the border
* @param aHeight the height of the border
*
*/
NS_IMETHOD GetBorderSize(PRInt32 &aWidth, PRInt32 &aHeight) = 0;
/**
* Get the foreground color for this widget
*
* @return this widget's foreground color
*
*/
virtual nscolor GetForegroundColor(void) = 0;
/**
* Set the foreground color for this widget
*
* @param aColor the new foreground color
*
*/
NS_IMETHOD SetForegroundColor(const nscolor &aColor) = 0;
/**
* Get the background color for this widget
*
* @return this widget's background color
*
*/
virtual nscolor GetBackgroundColor(void) = 0;
/**
* Set the background color for this widget
*
* @param aColor the new background color
*
*/
NS_IMETHOD SetBackgroundColor(const nscolor &aColor) = 0;
/**
* Get the font for this widget
*
* @return the font metrics
*/
virtual nsIFontMetrics* GetFont(void) = 0;
/**
* Set the font for this widget
*
* @param aFont font to display. See nsFont for allowable fonts
*/
NS_IMETHOD SetFont(const nsFont &aFont) = 0;
/**
* Get the cursor for this widget.
*
* @return this widget's cursor.
*/
virtual nsCursor GetCursor(void) = 0;
/**
* Set the cursor for this widget
*
* @param aCursor the new cursor for this widget
*/
NS_IMETHOD SetCursor(nsCursor aCursor) = 0;
/**
* Invalidate the widget and repaint it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
NS_IMETHOD Invalidate(PRBool aIsSynchronous) = 0;
/**
* Invalidate a specified rect for a widget and repaints it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous) = 0;
/**
* Invalidate a specified region for a widget and repaints it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
NS_IMETHOD InvalidateRegion(const nsIRegion* aRegion, PRBool aIsSynchronous) = 0;
/**
* Force a synchronous repaint of the window if there are dirty rects.
*
* @see Invalidate()
*/
NS_IMETHOD Update() = 0;
/**
* Adds a mouse listener to this widget
* Any existing mouse listener is replaced
*
* @param aListener mouse listener to add to this widget.
*/
NS_IMETHOD AddMouseListener(nsIMouseListener * aListener) = 0;
/**
* Adds an event listener to this widget
* Any existing event listener is replaced
*
* @param aListener event listener to add to this widget.
*/
NS_IMETHOD AddEventListener(nsIEventListener * aListener) = 0;
/**
* Adds a menu listener to this widget
* Any existing menu listener is replaced
*
* @param aListener menu listener to add to this widget.
*/
NS_IMETHOD AddMenuListener(nsIMenuListener * aListener) = 0;
/**
* Return the widget's toolkit
*
* @return the toolkit this widget was created in. See nsToolkit.
*/
virtual nsIToolkit* GetToolkit() = 0;
/**
* Set the color map for this widget
*
* @param aColorMap color map for displaying this widget
*
*/
NS_IMETHOD SetColorMap(nsColorMap *aColorMap) = 0;
/**
* Scroll this widget.
*
* @param aDx amount to scroll along the x-axis
* @param aDy amount to scroll along the y-axis.
* @param aClipRect clipping rectangle to limit the scroll to.
*
*/
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) = 0;
/**
* Scroll an area of this widget.
*
* @param aRect source rectangle to scroll in the widget
* @param aDx x offset from the source
* @param aDy y offset from the source
*
*/
NS_IMETHOD ScrollRect(nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy) = 0;
/**
* Internal methods
*/
//@{
virtual void AddChild(nsIWidget* aChild) = 0;
virtual void RemoveChild(nsIWidget* aChild) = 0;
virtual void* GetNativeData(PRUint32 aDataType) = 0;
virtual void FreeNativeData(void * data, PRUint32 aDataType) = 0;//~~~
virtual nsIRenderingContext* GetRenderingContext() = 0;
virtual nsIDeviceContext* GetDeviceContext() = 0;
virtual nsIAppShell *GetAppShell() = 0;
//@}
/**
* Set border style
* Must be called before Create.
* @param aBorderStyle @see nsBorderStyle
*/
NS_IMETHOD SetBorderStyle(nsBorderStyle aBorderStyle) = 0;
/**
* Set the widget's title.
* Must be called after Create.
*
* @param aTitle string displayed as the title of the widget
*/
NS_IMETHOD SetTitle(const nsString& aTitle) = 0;
/**
* Set the widget's MenuBar.
* Must be called after Create.
*
* @param aMenuBar the menubar
*/
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) = 0;
/**
* Set the widget's MenuBar's visibility
*
* @param aShow PR_TRUE to show, PR_FALSE to hide
*/
NS_IMETHOD ShowMenuBar(PRBool aShow) = 0;
/**
* Convert from this widget coordinates to screen coordinates.
*
* @param aOldRect widget coordinates stored in the x,y members
* @param aNewRect screen coordinates stored in the x,y members
*/
NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect) = 0;
/**
* Convert from screen coordinates to this widget's coordinates.
*
* @param aOldRect screen coordinates stored in the x,y members
* @param aNewRect widget's coordinates stored in the x,y members
*/
NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect) = 0;
/**
* When adjustments are to made to a whole set of child widgets, call this
* before resizing/positioning the child windows to minimize repaints. Must
* be followed by EndResizingChildren() after child windows have been
* adjusted.
*
*/
NS_IMETHOD BeginResizingChildren(void) = 0;
/**
* Call this when finished adjusting child windows. Must be preceded by
* BeginResizingChildren().
*
*/
NS_IMETHOD EndResizingChildren(void) = 0;
/**
* Returns the preferred width and height for the widget
*
*/
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight) = 0;
/**
* Set the preferred width and height for the widget
*
*/
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight) = 0;
/**
* Dispatches and event to the widget
*
*/
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) = 0;
#ifdef LOSER
/**
* FSets the vertical scrollbar widget
*
*/
NS_IMETHOD SetVerticalScrollbar(nsIWidget * aScrollbar) = 0;
#endif
/**
* For printing and lightweight widgets
*
*/
NS_IMETHOD Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect) = 0;
/**
* Enables the dropping of files to a widget (XXX this is temporary)
*
*/
NS_IMETHOD EnableDragDrop(PRBool aEnable) = 0;
virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) = 0;
/**
* Enables/Disables system mouse capture.
* @param aCapture PR_TRUE enables mouse capture, PR_FALSE disables mouse capture
*
*/
NS_IMETHOD CaptureMouse(PRBool aCapture) = 0;
/**
* Enables/Disables system capture of any and all events that would cause a
* dropdown to be rolled up, This method ignores the aConsumeRollupEvent
* parameter when aDoCapture is FALSE
* @param aCapture PR_TRUE enables capture, PR_FALSE disables capture
* @param aConsumeRollupEvent PR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event
*
*/
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent) = 0;
/**
* Determine whether a given event should be processed assuming we are
* the currently active modal window.
* Note that the exact semantics of this method are platform-dependent.
* The Macintosh, for instance, cares deeply that this method do exactly
* as advertised. Gtk, for instance, handles modality in a completely
* different fashion and does little if anything with this method.
* @param aRealEvent event is real or a null placeholder (Macintosh)
* @param aEvent void pointer to native event structure
* @param aForWindow return value. PR_TRUE iff event should be processed.
*/
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, PRBool *aForWindow) = 0;
};
#endif // nsIWidget_h__

View File

@@ -1,556 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
* Rod Spears <rods@netscape.com>
* Kevin McCluskey <kmcclusk@netscape.com>
* Mike Pinkerton <pinkerton@netscape.com>
* ... and other people
*/
#include "nsISupports.idl"
#include "nsIScriptableRegion.idl"
#include "nsIRollupListener.idl"
#include "nsIToolkit.idl"
#include "nsIAppShell.idl"
#include "nsIEnumerator.idl"
%{ C++
#include "nsRect.h"
#include "nsColor.h"
#include "nsIMouseListener.h"
#include "nsIMenuListener.h"
#include "nsIImage.h"
#include "prthread.h"
#include "nsGUIEvent.h"
// forward declarations
class nsIAppShell;
class nsIToolkit;
class nsIRenderingContext;
class nsIEnumerator;
class nsIDeviceContext;
struct nsRect;
struct nsFont;
class nsIEventListener;
class nsIRollupListener;
%}
[ptr] native nsGUIEvent(nsGUIEvent);
[ptr] native nsIMouseListener(nsIMouseListener);
[ptr] native nsIEventListener(nsIEventListener);
[ptr] native nsIMenuListener(nsIMenuListener);
[ptr] native nsIRegion(nsIRegion);
[ptr] native nsRect(nsRect);
[ref] native nsRectRef(nsRect);
[ptr] native nsFont(nsFont);
[ptr] native nsColorMap(nsColorMap);
[ptr] native nsIRenderingContext(nsIRenderingContext);
[ptr] native nsIDeviceContext(nsIDeviceContext);
native nscolor(nscolor);
native nscoord(nscoord);
native nsEventStatus(nsEventStatus);
[ref] native nsEventStatusRef(nsEventStatus);
native PR_CALLBACK(PR_CALLBACKK);
native EVENT_CALLBACK(EVENT_CALLBACK);
typedef long nsCursor;
/*
* Hide the native window systems real window type so as to avoid
* including native window system types and api's. This is necessary
* to ensure cross-platform code.
*/
typedef voidStar nsNativeWidget;
%{ C++
typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event);
/**
* Basic struct for widget initialization data.
* @see Create member function of nsIWidget
*/
struct nsWidgetInitData {
nsWidgetInitData()
: clipChildren(PR_FALSE), clipSiblings(PR_FALSE)
// mWindowType(eWindowType_child),
// mBorderStyle(eBorderStyle_default)
{
}
// when painting exclude area occupied by child windows and sibling windows
PRPackedBool clipChildren, clipSiblings;
// nsWindowType mWindowType;
// nsBorderStyle mBorderStyle;
};
%}
[uuid(18032AD5-B265-11d1-AA2A-000000000000)]
interface nsIWidget : nsISupports
{
/*
* Flags for GetNativeData()
*/
const short NS_NATIVE_WINDOW = 0;
const short NS_NATIVE_GRAPHIC = 1;
const short NS_NATIVE_COLORMAP = 2;
const short NS_NATIVE_WIDGET = 3;
const short NS_NATIVE_DISPLAY = 4;
const short NS_NATIVE_REGION = 5;
const short NS_NATIVE_OFFSETX = 6;
const short NS_NATIVE_OFFSETY = 7;
const short NS_NATIVE_PLUGIN_PORT = 8;
const short NS_NATIVE_SCREEN = 9;
/**
* Cursor types.
*/
//(normal cursor, usually rendered as an arrow)
const long eCursor_standard = 0;
//(system is busy, usually rendered as a hourglass or watch)
const long eCursor_wait = 1;
//(Selecting something, usually rendered as an IBeam)
const long eCursor_select = 2;
//(can hyper-link, usually rendered as a human hand)
const long eCursor_hyperlink = 3;
//(west/east sizing, usually rendered as ->||<-)
const long eCursor_sizeWE = 4;
//(north/south sizing, usually rendered as sizeWE rotated 90 degrees)
const long eCursor_sizeNS = 5;
const long eCursor_arrow_north = 6;
const long eCursor_arrow_north_plus = 7;
const long eCursor_arrow_south = 8;
const long eCursor_arrow_south_plus = 9;
const long eCursor_arrow_west = 10;
const long eCursor_arrow_west_plus = 11;
const long eCursor_arrow_east = 12;
const long eCursor_arrow_east_plus = 13;
const long eCursor_crosshair = 14;
//Don't know what 'move' cursor should be. See CSS2.
const long eCursor_move = 15;
const long eCursor_help = 16;
/**
* initialize a widget
*
* The widget represents a window that can be drawn into. It also is the
* base class for user-interface widgets such as buttons and text boxes.
*
* All the arguments can be NULL in which case a top level window
* with size 0 is created. The event callback function has to be
* provided only if the caller wants to deal with the events this
* widget receives. The event callback is basically a preprocess
* hook called synchronously. The return value determines whether
* the event goes to the default window procedure or it is hidden
* to the os. The assumption is that if the event handler returns
* false the widget does not see the event. The widget should not
* automatically clear the window to the background color. The
* calling code must handle paint messages and clear the background
* itself.
*
* @param aAppShell the parent application shell. If nsnull,
* the parent window's application shell will be used.
* @param aToolkit toolkit
* @param aContext device context
* @param aEventFunction the event handler callback function
*
*/
void initWidget(in nsIAppShell aAppShell,
in nsIToolkit aToolkit,
in nsIDeviceContext aContext,
in EVENT_CALLBACK aEventFunction);
/**
* Get some kind of native data
*/
voidStar getNativeData(in PRUint32 aDataType);
/**
* Move this widget.
*
* @param aX the new x position expressed in the parent's coordinate system
* @param aY the new y position expressed in the parent's coordinate system
*
**/
void move(in PRInt32 aX, in PRInt32 aY);
/**
* Resize this widget.
*
* @param aWidth the new width expressed in the parent's coordinate system
* @param aHeight the new height expressed in the parent's coordinate system
* @param aRepaint whether the widget should be repainted
*
*/
void resize(in PRInt32 aWidth,
in PRInt32 aHeight,
in PRBool aRepaint);
/**
* Move and resize this widget.
*
* @param aX the new x position expressed in the parent's coordinate system
* @param aY the new y position expressed in the parent's coordinate system
* @param aWidth the new width expressed in the parent's coordinate system
* @param aHeight the new height expressed in the parent's coordinate system
* @param aRepaint whether the widget should be repainted if the size changes
*
*/
void moveResize(in PRInt32 aX,
in PRInt32 aY,
in PRInt32 aWidth,
in PRInt32 aHeight,
in PRBool aRepaint);
/**
* Enable or disable this Widget
*
* @param aState PR_TRUE to enable the Widget, PR_FALSE to disable it.
*
*/
void enable(in PRBool aState);
// XXX GO AWAY
/**
* Get this widget's outside dimensions relative to it's parent widget
*
* @param aRect on return it holds the x. y, width and height of this widget
*
*/
// readonly attribute nsRect Bounds;
// this is really out..
void getBounds(in nsRectRef aRect);
// XXX keep this, but make it ints
/**
* Get this widget's client area dimensions, if the window has a 3D border appearance
* this returns the area inside the border, The x and y are always zero
*
* @param aRect on return it holds the x. y, width and height of the client area of this widget
*
*/
// readonly attribute nsRect ClientBounds;
// this is really out..
void getClientBounds(in nsRectRef aRect);
// Is this still used?
/**
* Returns the preferred width and height for the widget
*
*/
void getPreferredSize(out PRInt32 aWidth,
out PRInt32 aHeight);
/**
* Set the preferred width and height for the widget
*
*/
void setPreferredSize(in PRInt32 aWidth, in PRInt32 aHeight);
/**
* Invalidate the widget and repaint it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
void invalidate(in PRBool aIsSynchronous);
/**
* Invalidate a specified rect for a widget and repaints it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
void invalidateRect([const] in nsRect aRect, in PRBool aIsSynchronous);
/**
* Invalidate a specified rect for a widget and repaints it.
*
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
* @see #Update()
*/
// void InvalidateRegion([const] in nsIScriptableRegion aRegion, in PRBool aIsSynchronous);
void invalidateRegion([const] in nsIRegion aRegion, in PRBool aIsSynchronous);
/**
* Force a synchronous repaint of the window if there are dirty rects.
*
* @see Invalidate()
*/
void update();
/**
* Convert from this widget coordinates to screen coordinates.
*
* @param aOldRect widget coordinates stored in the x,y members
* @param aNewRect screen coordinates stored in the x,y members
*/
void widgetToScreen([const] in nsRect aOldRect, out nsRect aNewRect);
/**
* Convert from screen coordinates to this widget's coordinates.
*
* @param aOldRect screen coordinates stored in the x,y members
* @param aNewRect widget's coordinates stored in the x,y members
*/
void screenToWidget([const] in nsRect aOldRect, out nsRect aNewRect);
// is this used?
void convertToDeviceCoordinates(inout nscoord aX, inout nscoord aY);
// can this go away?
/**
* For printing and lightweight widgets
*
*/
void paint(in nsIRenderingContext aRenderingContext,
[const] in nsRect aDirtyRect);
/**
* Enables the dropping of files to a widget (XXX this is temporary)
*
*/
void enableDragDrop(in PRBool aEnable);
/**
* Enables/Disables system mouse capture.
* @param aCapture PR_TRUE enables mouse capture, PR_FALSE disables mouse capture
*
*/
void captureMouse(in PRBool aCapture);
/**
* Enables/Disables system capture of any and all events that would cause a
* dropdown to be rolled up, This method ignores the aConsumeRollupEvent
* parameter when aDoCapture is FALSE
* @param aCapture PR_TRUE enables capture, PR_FALSE disables capture
* @param aConsumeRollupEvent PR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event
*
*/
void captureRollupEvents(in nsIRollupListener aListener, in PRBool aDoCapture, in PRBool aConsumeRollupEvent);
/**
* Adds a mouse listener to this widget
* Any existing mouse listener is replaced
*
* @param aListener mouse listener to add to this widget.
*/
void addMouseListener(in nsIMouseListener aListener);
/**
* Adds an event listener to this widget
* Any existing event listener is replaced
*
* @param aListener event listener to add to this widget.
*/
void addEventListener(in nsIEventListener aListener);
/**
* Adds a menu listener to this widget
* Any existing menu listener is replaced
*
* @param aListener menu listener to add to this widget.
*/
void addMenuListener(in nsIMenuListener aListener);
// is this an internal method?
/**
* Dispatches and event to the widget
*
*/
void dispatchEvent(in nsGUIEvent event, in nsEventStatusRef aStatus);
/**
* Internal methods
*/
void addChild(in nsIWidget aChild);
void removeChild(in nsIWidget aChild);
/* ATTRIBUTES */
/**
* Device Context used to do printing... probably shouldn't be here
*/
readonly attribute nsIDeviceContext deviceContext;
/* attributes */
/**
* Get the AppShell
*/
readonly attribute nsIAppShell appShell;
/**
* Get the nsIToolkit
*/
readonly attribute nsIToolkit toolkit;
/**
* callback for the event
*/
[noscript] readonly attribute EVENT_CALLBACK eventFunction;
/* things that MUST be set AFTER the widget is created */
/**
* Get and Set the widget's z-index.
*/
attribute PRInt32 zIndex;
/**
* Set/Get the foreground color for this widget
*
* @param aColor the new foreground color
*
*/
attribute nscolor foregroundColor;
/**
* Set/Get the background color for this widget
*
* @param aColor the new background color
*
*/
attribute nscolor backgroundColor;
/**
* Set/Get the font for this widget
*
* @param aFont font to display. See nsFont for allowable fonts
*/
attribute nsFont font;
/**
* Set/Get the cursor for this widget
*
* @param aCursor the new cursor for this widget
*/
attribute nsCursor cursor;
/**
* Set the color map for this widget
*
* @param aColorMap color map for displaying this widget
*
*/
attribute nsColorMap colorMap;
/**
* Accessor functions to get and set the client data associated with the
* widget.
*/
attribute voidStar clientData;
/**
* Return an nsEnumerator over the children of this widget.
*
* @return an enumerator over the list of children or nsnull if it does not
* have any children
*
*/
readonly attribute nsIEnumerator children;
%{ C++
/* backwards compat stuff */
NS_IMETHOD Show(PRBool aShow) = 0;
NS_IMETHOD IsVisible(PRBool & aState) = 0;
NS_IMETHOD Resize(PRInt32 aX,
PRInt32 aY,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint) = 0;
virtual nscolor GetForegroundColor(void) = 0;
virtual nscolor GetBackgroundColor(void) = 0;
NS_IMETHOD SetFont(const nsFont &aFont) = 0;
virtual nsIFontMetrics* GetFont(void) = 0;
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous) = 0;
NS_IMETHOD SetTitle(const nsString& aTitle) = 0;
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight) = 0;
virtual nsIWidget* GetParent(void) = 0;
virtual nsIEnumerator* GetChildren(void) = 0;
virtual void* GetNativeData(PRUint32 aDataType) = 0;
virtual void FreeNativeData(void * data, PRUint32 aDataType) = 0;
virtual nsIRenderingContext* GetRenderingContext() = 0;
virtual nsIDeviceContext* GetDeviceContext() = 0;
virtual nsIAppShell *GetAppShell() = 0;
virtual nsIToolkit* GetToolkit() = 0;
/* the big ugly ones */
NS_IMETHOD Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0;
NS_IMETHOD Create(nsNativeWidget aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0;
%}
};

View File

@@ -1,203 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
* Rod Spears <rods@netscape.com>
* Kevin McCluskey <kmcclusk@netscape.com>
* Mike Pinkerton <pinkerton@netscape.com>
* ... and other people
*/
#include "nsISupports.idl"
#include "nsIWidget.idl"
%{ C++
#include "nsRect.h"
#include "nsIMouseListener.h"
#include "nsIMenuListener.h"
#include "nsIImage.h"
#include "prthread.h"
#include "nsGUIEvent.h"
// forward declarations
struct nsRect;
class nsIMenuBar;
%}
[ptr] native nsIMenuBar(nsIMenuBar);
typedef long nsBorderStyle;
typedef long nsWindowType;
[uuid(491359ea-1dd2-11b2-af7c-bb0346efd9b6)]
interface nsIWindow : nsIWidget
{
/*
* types of windows
*/
const long eWindowType_toplevel = 0;
const long eWindowType_dialog = 1;
const long eWindowType_popup = 2;
const long eWindowType_child = 3;
/*
* Border styles
*/
// no border, titlebar, etc.. opposite of all
const long eBorderStyle_none = 0;
// all window decorations
const long eBorderStyle_all = 1 << 0;
// enables the border on the window. these are only for decoration and are not resize hadles
const long eBorderStyle_border = 1 << 1;
// enables the resize handles for the window. if this is set, border is implied to also be set
const long eBorderStyle_resizeh = 1 << 2;
// enables the titlebar for the window
const long eBorderStyle_title = 1 << 3;
// enables the window menu button on the title bar. this being on should force the title bar to display
const long eBorderStyle_menu = 1 << 4;
// enables the minimize button so the user can minimize the window.
// turned off for tranient windows since they can not be minimized seperate from their parent
const long eBorderStyle_minimize = 1 << 5;
// enables the maxmize button so the user can maximize the window
const long eBorderStyle_maximize = 1 << 6;
// show the close button
const long eBorderStyle_close = 1 << 7;
// whatever the OS wants... i.e. don't do anything
const long eBorderStyle_default = -1;
/**
* initialize a window
*
* The widget represents a window that can be drawn into. It also is the
* base class for user-interface widgets such as buttons and text boxes.
*
* All the arguments can be NULL in which case a top level window
* with size 0 is created. The event callback function has to be
* provided only if the caller wants to deal with the events this
* widget receives. The event callback is basically a preprocess
* hook called synchronously. The return value determines whether
* the event goes to the default window procedure or it is hidden
* to the os. The assumption is that if the event handler returns
* false the widget does not see the event. The widget should not
* automatically clear the window to the background color. The
* calling code must handle paint messages and clear the background
* itself.
*
* @param aWindowType type of window to create
* @param aBorderStyle border style of the window to create
*
*/
void initWindowStyle(in nsWindowType aWindowType,
in nsBorderStyle aBorderStyle);
/**
* Make the window modal
*
*
*
*/
void setModal(in boolean modal);
/**
* Gets the width and height of the borders
* @param aWidth the width of the border
* @param aHeight the height of the border
*
*/
void getBorderSize(out PRInt32 aWidth, out PRInt32 aHeight);
/**
* Scroll this widget.
*
* @param aDx amount to scroll along the x-axis
* @param aDy amount to scroll along the y-axis.
* @param aClipRect clipping rectangle to limit the scroll to.
*
*/
void scroll(in PRInt32 aDx, in PRInt32 aDy, in nsRect aClipRect);
/**
* Scroll an area of this widget.
*
* @param aRect source rectangle to scroll in the widget
* @param aDx x offset from the source
* @param aDy y offset from the source
*
*/
void scrollRect(in nsRectRef aSrcRect, in PRInt32 aDx, in PRInt32 aDy);
/**
* Set the widget's MenuBar.
* Must be called after Create.
*
* @param aMenuBar the menubar
*/
void setMenuBar(in nsIMenuBar aMenuBar);
/**
* Set the widget's MenuBar's visibility
*
* @param aShow PR_TRUE to show, PR_FALSE to hide
*/
void showMenuBar(in PRBool aShow);
/**
* When adjustments are to made to a whole set of child widgets, call this
* before resizing/positioning the child windows to minimize repaints. Must
* be followed by EndResizingChildren() after child windows have been
* adjusted.
*
*/
void beginResizingChildren();
/**
* Call this when finished adjusting child windows. Must be preceded by
* BeginResizingChildren().
*
*/
void endResizingChildren();
/* ATTRIBUTES */
/**
* Window type
*/
readonly attribute nsWindowType windowType;
/**
* Border style
*/
readonly attribute nsBorderStyle borderStyle;
};

View File

@@ -1,64 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsRepeater_h___
#define nsRepeater_h___
#include "nscore.h"
class EventRecord;
class NS_BASE Repeater {
public:
Repeater();
virtual ~Repeater();
virtual void RepeatAction(const EventRecord &aMacEvent) = 0;
void StartRepeating();
void StopRepeating();
void StartIdling();
void StopIdling();
static void DoRepeaters(const EventRecord &aMacEvent);
static void DoIdlers(const EventRecord &aMacEvent);
protected:
void AddToRepeatList();
void RemoveFromRepeatList();
void AddToIdleList();
void RemoveFromIdleList();
static Repeater* sRepeaters;
static Repeater* sIdlers;
bool mRepeating;
bool mIdling;
Repeater* mPrevRptr;
Repeater* mNextRptr;
Repeater* mPrevIdlr;
Repeater* mNextIdlr;
};
#endif

View File

@@ -1,54 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
// Convience macros for converting nsString's to chars +
// creating temporary char[] bufs.
#ifndef NS_STR_UTIL_H
#define NS_STR_UTIL_H
// nsString to temporary char[] macro
// Convience MACROS to convert an nsString to a char * which use a
// static char array if possible to reduce memory fragmentation,
// otherwise they allocate a char[] which must be freed.
// REMEMBER to always use the NS_FREE_STR_BUF after using the
// NS_ALLOC_STR_BUF. You can not nest NS_ALLOC_STR_BUF's.
#define NS_ALLOC_CHAR_BUF(aBuf, aSize, aActualSize) \
int _ns_tmpActualSize = aActualSize; \
char _ns_smallBuffer[aSize]; \
char * const aBuf = _ns_tmpActualSize <= aSize ? _ns_smallBuffer : new char[_ns_tmpActualSize];
#define NS_FREE_CHAR_BUF(aBuf) \
if (aBuf != _ns_smallBuffer) \
delete[] aBuf;
#define NS_ALLOC_STR_BUF(aBuf, aStrName, aTempSize) \
NS_ALLOC_CHAR_BUF(aBuf, aTempSize, aStrName.Length()+1); \
aStrName.ToCString(aBuf, aStrName.Length()+1);
#define NS_FREE_STR_BUF(aBuf) \
NS_FREE_CHAR_BUF(aBuf)
#endif // NSStringUtil

View File

@@ -1,141 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsWidgetSupport_h__
#define nsWidgetSupport_h__
#include "nscore.h"
#include "nsISupports.h"
#include "nsIWidget.h"
struct nsRect;
class nsITextAreaWidget;
class nsIFileWidget;
class nsIAppShell;
class nsIButton;
class nsIComboBox;
class nsIEventListener;
class nsILabel;
class nsIListBox;
class nsIListWidget;
class nsILookAndFeel;
class nsIMouseListener;
class nsIToolkit;
class nsIWidget;
class nsICheckButton;
class nsIScrollbar;
class nsIRadioButton;
class nsITextWidget;
class nsIBrowserWindow;
// These are a series of support methods which help in the creation
// of widgets. They are not needed, but are provided as a convenience
// mechanism when creating widgets
extern NS_WIDGET nsresult
NS_CreateButton( nsISupports* aParent,
nsIButton* aButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateCheckButton( nsISupports* aParent,
nsICheckButton* aCheckButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateRadioButton( nsISupports* aParent,
nsIRadioButton* aButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateLabel( nsISupports* aParent,
nsILabel* aLabel,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateTextWidget(nsISupports* aParent,
nsITextWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateTextAreaWidget(nsISupports* aParent,
nsITextAreaWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateListBox(nsISupports* aParent,
nsIListBox* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateComboBox(nsISupports* aParent,
nsIComboBox* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateScrollBar(nsISupports* aParent,
nsIScrollbar* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction);
extern NS_WIDGET nsresult
NS_ShowWidget(nsISupports* aWidget, PRBool aShow);
extern NS_WIDGET nsresult
NS_MoveWidget(nsISupports* aWidget, PRUint32 aX, PRUint32 aY);
extern NS_WIDGET nsresult
NS_EnableWidget(nsISupports* aWidget, PRBool aEnable);
extern NS_WIDGET nsresult
NS_SetFocusToWidget(nsISupports* aWidget);
extern NS_WIDGET nsresult
NS_GetWidgetNativeData(nsISupports* aWidget, void** aNativeData);
#endif

View File

@@ -1,200 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* 2d96b3d0-c051-11d1-a827-0040959a28c9 */
#define NS_WINDOW_CID \
{ 0x2d96b3d0, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9}}
/* 2d96b3d1-c051-11d1-a827-0040959a28c9 */
#define NS_CHILD_CID \
{ 0x2d96b3d1, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* BA7DE611-6088-11d3-A83E-00105A183419 */
#define NS_POPUP_CID \
{ 0xba7de611, 0x6088, 0x11d3, \
{ 0xa8, 0x3e, 0x0, 0x10, 0x5a, 0x18, 0x34, 0x19 } }
/* 2d96b3d2-c051-11d1-a827-0040959a28c9 */
#define NS_BUTTON_CID \
{ 0x2d96b3d2, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d3-c051-11d1-a827-0040959a28c9 */
#define NS_CHECKBUTTON_CID \
{ 0x2d96b3d3, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d4-c051-11d1-a827-0040959a28c9 */
#define NS_COMBOBOX_CID \
{ 0x2d96b3d4, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d5-c051-11d1-a827-0040959a28c9 */
#define NS_FILEWIDGET_CID \
{ 0x2d96b3d5, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d6-c051-11d1-a827-0040959a28c9 */
#define NS_LISTBOX_CID \
{ 0x2d96b3d6, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d7-c051-11d1-a827-0040959a28c9 */
#define NS_RADIOBUTTON_CID \
{ 0x2d96b3d7, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3d9-c051-11d1-a827-0040959a28c9 */
#define NS_HORZSCROLLBAR_CID \
{ 0x2d96b3d9, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3da-c051-11d1-a827-0040959a28c9 */
#define NS_VERTSCROLLBAR_CID \
{ 0x2d96b3da, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3db-c051-11d1-a827-0040959a28c9 */
#define NS_TEXTAREA_CID \
{ 0x2d96b3db, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3dc-c051-11d1-a827-0040959a28c9 */
#define NS_TEXTFIELD_CID \
{ 0x2d96b3dc, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3df-c051-11d1-a827-0040959a28c9 */
#define NS_APPSHELL_CID \
{ 0x2d96b3df, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3e0-c051-11d1-a827-0040959a28c9 */
#define NS_TOOLKIT_CID \
{ 0x2d96b3e0, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* XXX the following CID's are not in order. This needs
to be fixed. */
/* 21B51DE0-21A3-11d2-B6E0-00805F8A2676 */
#define NS_LOOKANDFEEL_CID \
{ 0x21b51de0, 0x21a3, 0x11d2, \
{ 0xb6, 0xe0, 0x0, 0x80, 0x5f, 0x8a, 0x26, 0x76 } }
/* 4A781D61-3D28-11d2-8DB8-00609703C14E */
#define NS_DIALOG_CID \
{ 0x4a781d61, 0x3d28, 0x11d2, \
{ 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/* F3131891-3DC7-11d2-8DB8-00609703C14E */
#define NS_LABEL_CID \
{ 0xf3131891, 0x3dc7, 0x11d2, \
{ 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
//-----------------------------------------------------------
// Menus
//-----------------------------------------------------------
// {BC658C81-4BEB-11d2-8DBB-00609703C14E}
#define NS_MENUBAR_CID \
{ 0xbc658c81, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
// {35A3DEC1-4992-11d2-8DBA-00609703C14E}
#define NS_MENU_CID \
{ 0x35a3dec1, 0x4992, 0x11d2, \
{ 0x8d, 0xba, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
// {7F045771-4BEB-11d2-8DBB-00609703C14E}
#define NS_MENUITEM_CID \
{ 0x7f045771, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
// {1677DAE1-04E2-11d3-B35C-00A0CC3C1CDE}
#define NS_CONTEXTMENU_CID \
{ 0x1677dae1, 0x4e2, 0x11d3, \
{ 0xb3, 0x5c, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } }
//f58c2550-4a7c-11d2-bee2-00805f8a8dbd
#define NS_IMAGEBUTTON_CID \
{ 0xf58c2550, 0x4a7c, 0x11d2, \
{0xbe, 0xe2, 0x00, 0x80, 0x5f, 0x8a, 0x8d, 0xbd} }
// {F6CD4F21-53AF-11d2-8DC4-00609703C14E}
#define NS_POPUPMENU_CID \
{ 0xf6cd4f21, 0x53af, 0x11d2, \
{ 0x8d, 0xc4, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
#define NS_MENUBUTTON_CID \
{ 0x67b8e261, 0x53c3, 0x11d2, \
{ 0x8d, 0xc4, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
// {D3C3B8B2-55B5-11d2-9A2A-000000000000}
#define NS_IMAGEBUTTONLISTENER_CID \
{ 0xd3c3b8b2, 0x55b5, 0x11d2, \
{ 0x9a, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
// {285EF9B2-094A-11d3-9A87-0050046CDA96}
#define NS_FONTRETRIEVERSERVICE_CID \
{ 0x285ef9b2, 0x94a, 0x11d3, { 0x9a, 0x87, 0x0, 0x50, 0x4, 0x6c, 0xda, 0x96 } }
//-----------------------------------------------------------
//Drag & Drop & Clipboard
//-----------------------------------------------------------
// {8B5314BB-DB01-11d2-96CE-0060B0FB9956}
#define NS_DRAGSERVICE_CID \
{ 0x8b5314bb, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
// {8B5314BC-DB01-11d2-96CE-0060B0FB9956}
#define NS_TRANSFERABLE_CID \
{ 0x8b5314bc, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
// {8B5314BA-DB01-11d2-96CE-0060B0FB9956}
#define NS_CLIPBOARD_CID \
{ 0x8b5314ba, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
// {8B5314BD-DB01-11d2-96CE-0060B0FB9956}
#define NS_DATAFLAVOR_CID \
{ 0x8b5314bd, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
// {948A0023-E3A7-11d2-96CF-0060B0FB9956}
#define NS_XIFFORMATCONVERTER_CID \
{ 0x948a0023, 0xe3a7, 0x11d2, { 0x96, 0xcf, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
#define NS_DATAOBJ_CID \
{ 0x1bba7640, 0xdf52, 0x11cf, { 0x82, 0x7b, 0, 0xa0, 0x24, 0x3a, 0xe5, 0x05 } }
// {E93E73B1-0197-11d3-96D4-0060B0FB9956}
#define NS_FILELISTTRANSFERABLE_CID \
{ 0xe93e73b1, 0x197, 0x11d3, { 0x96, 0xd4, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
//-----------------------------------------------------------
//Other
//-----------------------------------------------------------
// {B148EED2-236D-11d3-B35C-00A0CC3C1CDE}
#define NS_SOUND_CID \
{ 0xb148eed2, 0x236d, 0x11d3, { 0xb3, 0x5c, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } }

View File

@@ -1,62 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = xpwidgets support
#
# Dont build the DSO under the 'build' directory as windows does.
#
# The DSOs get built in the toolkit dir itself. Do this so that
# multiple implementations of widget can be built on the same
# source tree.
#
ifndef MOZ_MONOLITHIC_TOOLKIT
ifdef MOZ_ENABLE_GTK
DIRS += gtk
endif
ifdef MOZ_ENABLE_MOTIF
DIRS += motif
endif
ifdef MOZ_ENABLE_XLIB
DIRS += xlib
endif
ifdef MOZ_ENABLE_QT
DIRS += qt
endif
else
DIRS += $(MOZ_WIDGET_TOOLKIT)
endif
# unix_services are only useful in unix, duh...
ifeq (,$(filter beos os2 rhapsody photon,$(MOZ_WIDGET_TOOLKIT)))
DIRS += unix_services
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -1,75 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = widget_beos
REQUIRES = util img xpcom raptor netlib
CPPSRCS = \
nsAppShell.cpp \
nsButton.cpp \
nsCheckButton.cpp \
nsClipboard.cpp \
nsComboBox.cpp \
nsDragService.cpp \
nsFileWidget.cpp \
nsFontRetrieverService.cpp \
nsFontSizeIterator.cpp \
nsLabel.cpp \
nsListBox.cpp \
nsLookAndFeel.cpp \
nsMenu.cpp \
nsMenuBar.cpp \
nsMenuItem.cpp \
nsObject.cpp \
nsPopUpMenu.cpp \
nsRadioButton.cpp \
nsScrollbar.cpp \
nsSound.cpp \
nsTextAreaWidget.cpp \
nsTextHelper.cpp \
nsTextWidget.cpp \
nsToolkit.cpp \
nsWidgetFactory.cpp \
nsWindow.cpp \
$(NULL)
SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.a
EXTRA_DSO_LDOPTS = \
$(TOOLKIT_DSO_LDOPTS) \
$(MKSHLIB_FORCE_ALL) \
$(SHARED_LIBRARY_LIBS) \
$(MKSHLIB_UNFORCE_ALL) \
$(TK_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_WIDGET -I$(srcdir)/../xpwidgets -I$(srcdir)
CXXFLAGS += $(TK_CFLAGS)
$(LIBRARY) $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) Makefile

View File

@@ -1,332 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAppShell.h"
#include "nsIEventQueueService.h"
#include "nsIServiceManager.h"
#include "nsIWidget.h"
#include "nsIAppShell.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "plevent.h"
#include <stdlib.h>
#include <AppKit.h>
#include <AppFileInfo.h>
struct ThreadInterfaceData
{
void *data;
int32 sync;
};
static sem_id my_find_sem(const char *name)
{
sem_id ret = B_ERROR;
/* Get the sem_info for every sempahore in this team. */
sem_info info;
int32 cookie = 0;
while(get_next_sem_info(0, &cookie, &info) == B_OK)
if(strcmp(name, info.name) == 0)
{
ret = info.sem;
break;
}
return ret;
}
//-------------------------------------------------------------------------
//
// nsISupports implementation macro
//
//-------------------------------------------------------------------------
NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID);
NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
NS_IMPL_ISUPPORTS(nsAppShell,kIAppShellIID);
static bool GetAppSig(char *sig)
{
app_info appInfo;
BFile file;
BAppFileInfo appFileInfo;
image_info info;
int32 cookie = 0;
*sig = 0;
return 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;
}
class nsBeOSApp : public BApplication
{
sem_id init;
public:
nsBeOSApp(const char *signature, sem_id initsem);
virtual void ReadyToRun(void);
};
nsBeOSApp::nsBeOSApp(const char *signature, sem_id initsem)
: BApplication(signature), init(initsem)
{
}
void nsBeOSApp::ReadyToRun(void)
{
release_sem(init);
}
int32 bapp_thread(void *arg)
{
// create and start BApplication
char sig[B_MIME_TYPE_LENGTH + 1];
GetAppSig(sig);
nsBeOSApp *app = new nsBeOSApp(sig, (sem_id)arg);
app->Run();
return 0;
}
//-------------------------------------------------------------------------
//
// nsAppShell constructor
//
//-------------------------------------------------------------------------
nsAppShell::nsAppShell()
{
NS_INIT_REFCNT();
mDispatchListener = 0;
sem_id initsem = create_sem(0, "bapp init");
resume_thread(spawn_thread(bapp_thread, "BApplication", B_NORMAL_PRIORITY, (void *)initsem));
acquire_sem(initsem);
delete_sem(initsem);
}
//-------------------------------------------------------------------------
//
// Create the application shell
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::Create(int* argc, char ** argv)
{
// system wide unique names
// NOTE: this needs to be run from within the main application thread
char portname[64];
char semname[64];
sprintf(portname, "event%lx", PR_GetCurrentThread());
sprintf(semname, "sync%lx", PR_GetCurrentThread());
if((eventport = find_port(portname)) < 0)
{
// we're here first
eventport = create_port(100, portname);
syncsem = create_sem(0, semname);
}
else
{
// the PLEventQueue stuff (in plevent.c) created the queue before we started
syncsem = my_find_sem(semname);
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Enter a message handler loop
//
//-------------------------------------------------------------------------
nsresult nsAppShell::Run()
{
int32 code;
ThreadInterfaceData id;
NS_ADDREF_THIS();
while(read_port(eventport, &code, &id, sizeof(id)) >= 0)
{
switch(code)
{
case 'WMti' :
extern void nsTimerExpired(void *); // hack: this is in gfx
nsTimerExpired(id.data);
break;
case WM_CALLMETHOD :
{
MethodInfo *mInfo = (MethodInfo *)id.data;
mInfo->Invoke();
if(! id.sync)
delete mInfo;
}
break;
case 'natv' : // native queue PLEvent
{
PREventQueue *queue = (PREventQueue *)id.data;
PR_ProcessPendingEvents(queue);
}
break;
default :
printf("nsAppShell::Run - UNKNOWN EVENT\n");
break;
}
if(mDispatchListener)
mDispatchListener->AfterDispatch();
if(id.sync)
release_sem(syncsem);
}
Release();
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Exit a message handler loop
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::Exit()
{
// interrupt message flow
close_port(eventport);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsAppShell destructor
//
//-------------------------------------------------------------------------
nsAppShell::~nsAppShell()
{
if(be_app->Lock())
be_app->Quit();
}
//-------------------------------------------------------------------------
//
// GetNativeData
//
//-------------------------------------------------------------------------
void* nsAppShell::GetNativeData(PRUint32 aDataType)
{
if (aDataType == NS_NATIVE_SHELL) {
return NULL;
}
return nsnull;
}
//-------------------------------------------------------------------------
//
// Spinup - do any preparation necessary for running a message loop
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::Spinup()
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Spindown - do any cleanup necessary for finishing a message loop
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::Spindown()
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// PushThreadEventQueue - begin processing events from a new queue
// note this is the Windows implementation and may suffice, but
// this is untested on beos.
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::PushThreadEventQueue()
{
nsresult rv;
// push a nested event queue for event processing from netlib
// onto our UI thread queue stack.
NS_WITH_SERVICE(nsIEventQueueService, eQueueService, kEventQueueServiceCID, &rv);
if (NS_SUCCEEDED(rv))
rv = eQueueService->PushThreadEventQueue();
else
NS_ERROR("Appshell unable to obtain eventqueue service.");
return rv;
}
//-------------------------------------------------------------------------
//
// PopThreadEventQueue - stop processing on a previously pushed event queue
// note this is the Windows implementation and may suffice, but
// this is untested on beos.
//
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::PopThreadEventQueue()
{
nsresult rv;
NS_WITH_SERVICE(nsIEventQueueService, eQueueService, kEventQueueServiceCID, &rv);
if (NS_SUCCEEDED(rv))
rv = eQueueService->PopThreadEventQueue();
else
NS_ERROR("Appshell unable to obtain eventqueue service.");
return rv;
}
NS_METHOD nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent)
{
printf("nsAppShell::GetNativeEvent - FIXME: not implemented\n");
return NS_OK;
}
NS_METHOD nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
{
printf("nsAppShell::DispatchNativeEvent - FIXME: not implemented\n");
return NS_OK;
}
NS_METHOD nsAppShell::EventIsForModalWindow(PRBool aRealEvent, void *aEvent, nsIWidget *aWidget, PRBool *aForWindow)
{
printf("nsAppShell::EventIsForModalWindow - FIXME: not implemented\n");
*aForWindow = PR_FALSE;
return NS_OK;
}

View File

@@ -1,60 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAppShell_h__
#define nsAppShell_h__
#include "nsObject.h"
#include "nsIAppShell.h"
#include <OS.h>
/**
* Native BeOS Application shell wrapper
*/
class nsAppShell : public nsIAppShell
{
public:
nsAppShell();
virtual ~nsAppShell();
NS_DECL_ISUPPORTS
// nsIAppShellInterface
NS_IMETHOD Create(int* argc, char ** argv);
virtual nsresult Run();
NS_IMETHOD Spinup();
NS_IMETHOD Spindown();
NS_IMETHOD PushThreadEventQueue();
NS_IMETHOD PopThreadEventQueue();
NS_IMETHOD GetNativeEvent(PRBool &aRealEvent, void *&aEvent);
NS_IMETHOD DispatchNativeEvent(PRBool aRealEvent, void * aEvent);
NS_IMETHOD EventIsForModalWindow(PRBool aRealEvent, void *aEvent,
nsIWidget *aWidget, PRBool *aForWindow);
NS_IMETHOD Exit();
NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener);
virtual void* GetNativeData(PRUint32 aDataType);
private:
nsDispatchListener *mDispatchListener;
port_id eventport;
sem_id syncsem;
};
#endif // nsAppShell_h__

View File

@@ -1,282 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsButton.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
#include "nsIComponentManager.h"
#include "nsIDeviceContext.h"
#include "nsIFontMetrics.h"
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
NS_IMPL_ADDREF(nsButton)
NS_IMPL_RELEASE(nsButton)
//-------------------------------------------------------------------------
//
// nsButton constructor
//
//-------------------------------------------------------------------------
nsButton::nsButton() : nsWindow() , nsIButton()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// nsButton destructor
//
//-------------------------------------------------------------------------
nsButton::~nsButton()
{
}
/**
* Implement the standard QueryInterface for NS_IWIDGET_IID and NS_ISUPPORTS_IID
* @modify gpk 8/4/98
* @param aIID The name of the class implementing the method
* @param _classiiddef The name of the #define symbol that defines the IID
* for the class (e.g. NS_ISUPPORTS_IID)
*
*/
nsresult nsButton::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
static NS_DEFINE_IID(kIButton, NS_IBUTTON_IID);
if (aIID.Equals(kIButton)) {
*aInstancePtr = (void*) ((nsIButton*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return nsWindow::QueryInterface(aIID,aInstancePtr);
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsButton::SetLabel(const nsString& aText)
{
mLabel = aText;
if(NULL == mView) {
return NS_ERROR_FAILURE;
}
NS_ALLOC_STR_BUF(label, aText, 256);
if(mButton)
{
if(mButton->Looper())
mButton->LockLooper();
mButton->SetLabel(label);
if(mButton->Looper())
mButton->UnlockLooper();
}
NS_FREE_STR_BUF(label);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsButton::GetLabel(nsString& aBuffer)
{
aBuffer = mLabel;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsButton::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsButton::OnPaint(nsRect &r)
{
//printf("** nsButton::OnPaint **\n");
return PR_FALSE;
}
PRBool nsButton::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
/**
* Renders the Button for Printing
*
**/
NS_METHOD nsButton::Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
float appUnits;
float devUnits;
float scale;
nsIDeviceContext * context;
aRenderingContext.GetDeviceContext(context);
context->GetCanonicalPixelScale(scale);
context->GetAppUnitsToDevUnits(devUnits);
context->GetDevUnitsToAppUnits(appUnits);
nsRect rect;
GetBoundsAppUnits(rect, appUnits);
aRenderingContext.SetColor(NS_RGB(0,0,0));
nscolor bgColor = NS_RGB(255,255,255);
nscolor fgColor = NS_RGB(0,0,0);
nscolor hltColor = NS_RGB(240,240,240);
nscolor sdwColor = NS_RGB(128,128,128);
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground, fgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow, sdwColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DHighlight, hltColor);
}
aRenderingContext.SetColor(bgColor);
aRenderingContext.FillRect(rect);
/*aRenderingContext.SetColor(bgColor);
for (int i=0;i<int(scale);i++) {
aRenderingContext.DrawRect(rect);
rect.x += 3;
rect.y += 3;
rect.width -= 6;
rect.height -= 6;
}*/
nscoord onePixel = nscoord(scale);
nscoord twoPixels = nscoord(scale*2);
rect.x += onePixel;
rect.y += onePixel;
rect.width -= twoPixels;
rect.height -= twoPixels;
nscoord right = rect.x+rect.width;
nscoord bottom = rect.y+rect.height;
// Draw Left & Top
aRenderingContext.SetColor(NS_RGB(225,225,225));
DrawScaledLine(aRenderingContext, rect.x, rect.y, right, rect.y, scale, appUnits, PR_TRUE); // top
DrawScaledLine(aRenderingContext, rect.x, rect.y, rect.x, bottom, scale, appUnits, PR_FALSE); // left
//DrawScaledLine(aRenderingContext, rect.x+onePixel, rect.y+onePixel, right-onePixel, rect.y+onePixel, scale, appUnits, PR_TRUE); // top + 1
//DrawScaledLine(aRenderingContext, rect.x+onePixel, rect.y+onePixel, rect.x+onePixel, bottom-onePixel, scale, appUnits, PR_FALSE); // left + 1
// Draw Right & Bottom
aRenderingContext.SetColor(NS_RGB(128,128,128));
DrawScaledLine(aRenderingContext, right, rect.y+onePixel, right, bottom, scale, appUnits, PR_FALSE); // right
DrawScaledLine(aRenderingContext, rect.x+onePixel, bottom, right, bottom, scale, appUnits, PR_TRUE); // bottom
//DrawScaledLine(aRenderingContext, right-onePixel, rect.y+twoPixels, right-onePixel, bottom, scale, appUnits, PR_FALSE); // right + 1
//DrawScaledLine(aRenderingContext, rect.x+twoPixels, bottom-onePixel, right, bottom-onePixel, scale, appUnits, PR_TRUE); // bottom + 1
aRenderingContext.SetFont(*mFont);
nscoord textWidth;
nscoord textHeight;
aRenderingContext.GetWidth(mLabel, textWidth);
nsIFontMetrics* metrics;
context->GetMetricsFor(*mFont, metrics);
metrics->GetMaxAscent(textHeight);
nscoord x = ((rect.width - textWidth) / 2) + rect.x;
nscoord y = ((rect.height - textHeight) / 2) + rect.y;
aRenderingContext.DrawString(mLabel, x, y);
NS_RELEASE(context);
return NS_OK;
}
BView *nsButton::CreateBeOSView()
{
return mButton = new nsButtonBeOS(this, BRect(0, 0, 0, 0), "", "");
}
//-------------------------------------------------------------------------
// Sub-class of BeOS Button
//-------------------------------------------------------------------------
nsButtonBeOS::nsButtonBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *aName, const char *aLabel, uint32 aResizingMode, uint32 aFlags )
: BButton( aFrame, aName, aLabel, new BMessage('clik'), aResizingMode, aFlags ),
nsIWidgetStore( aWidgetWindow )
{
}
void nsButtonBeOS::AttachedToWindow()
{
SetTarget(this);
}
void nsButtonBeOS::MessageReceived(BMessage *msg)
{
switch(msg->what)
{
case 'clik' :
{
nsWindow *w = (nsWindow *)GetMozillaWidget();
nsToolkit *t;
if(w && (t = w->GetToolkit()) != 0)
{
uint32 args[5];
args[0] = NS_MOUSE_LEFT_CLICK;
args[1] = (uint32)0;
args[2] = (uint32)0;
args[3] = 1;
args[4] = modifiers();
MethodInfo *info = new MethodInfo(w, w, nsWindow::BTNCLICK, 5, args);
t->CallMethodAsync(info);
NS_RELEASE(t);
}
}
break;
default :
BButton::MessageReceived(msg);
}
}

View File

@@ -1,77 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsButton_h__
#define nsButton_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsIButton.h"
#include <Button.h>
/**
* Native Win32 button wrapper
*/
class nsButton : public nsWindow,
public nsIButton
{
public:
nsButton();
virtual ~nsButton();
//nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// nsIButton part
NS_IMETHOD SetLabel(const nsString& aText);
NS_IMETHOD GetLabel(nsString& aBuffer);
// nsBaseWidget
NS_IMETHOD Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
virtual PRBool OnPaint(nsRect &r);
virtual PRBool OnResize(nsRect &aWindowRect);
protected:
nsString mLabel;
virtual BView *CreateBeOSView();
BButton *mButton;
};
//
// A BButton subclass
//
class nsButtonBeOS : public BButton, public nsIWidgetStore {
public:
nsButtonBeOS( nsIWidget *aWidgetWindow, BRect aFrame, const char *aName,
const char *aLabel, uint32 aResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 aFlags = B_WILL_DRAW | B_NAVIGABLE );
void AttachedToWindow();
void MessageReceived(BMessage *msg);
};
#endif // nsButton_h__

View File

@@ -1,102 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef CLIST_H
#define CLIST_H
#include <stddef.h>
// -----------------------------------------------------------------------
//
// 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

View File

@@ -1,237 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsCheckButton.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
#include "nsIComponentManager.h"
#include "nsIDeviceContext.h"
NS_IMPL_ADDREF(nsCheckButton)
NS_IMPL_RELEASE(nsCheckButton)
//-------------------------------------------------------------------------
//
// nsCheckButton constructor
//
//-------------------------------------------------------------------------
nsCheckButton::nsCheckButton() : nsWindow() , nsICheckButton(),
mState(PR_FALSE)
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// nsCheckButton destructor
//
//-------------------------------------------------------------------------
nsCheckButton::~nsCheckButton()
{
}
/**
* Implement the standard QueryInterface for NS_IWIDGET_IID and NS_ISUPPORTS_IID
* @modify gpk 8/4/98
* @param aIID The name of the class implementing the method
* @param _classiiddef The name of the #define symbol that defines the IID
* for the class (e.g. NS_ISUPPORTS_IID)
*
*/
nsresult nsCheckButton::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID);
if (aIID.Equals(kICheckButtonIID)) {
*aInstancePtr = (void*) ((nsICheckButton*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return nsWindow::QueryInterface(aIID,aInstancePtr);
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::SetState(const PRBool aState)
{
mState = aState;
if(mCheckBox && mCheckBox->LockLooper())
{
mCheckBox->SetValue(aState ? 1 : 0);
mCheckBox->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::GetState(PRBool& aState)
{
aState = mState;
if(mCheckBox && mCheckBox->LockLooper())
{
aState = mCheckBox->Value() ? PR_TRUE : PR_FALSE;
mCheckBox->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::SetLabel(const nsString& aText)
{
char label[256];
aText.ToCString(label, 256);
label[255] = '\0';
if(mCheckBox && mCheckBox->LockLooper())
{
mCheckBox->SetLabel(label);
mCheckBox->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::GetLabel(nsString& aBuffer)
{
if(mCheckBox && mCheckBox->LockLooper())
{
aBuffer.SetLength(0);
aBuffer.Append(mCheckBox->Label());
mCheckBox->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsCheckButton::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsCheckButton::OnPaint(nsRect &r)
{
return PR_FALSE;
}
PRBool nsCheckButton::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
/**
* Renders the CheckButton for Printing
*
**/
NS_METHOD nsCheckButton::Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
nsRect rect;
float appUnits;
float scale;
nsIDeviceContext * context;
aRenderingContext.GetDeviceContext(context);
context->GetCanonicalPixelScale(scale);
context->GetDevUnitsToAppUnits(appUnits);
GetBoundsAppUnits(rect, appUnits);
nscoord one = nscoord(PRFloat64(rect.height) * 1.0/20.0);
nscoord three = nscoord(PRFloat64(rect.width) * 3.0/20.0);
nscoord five = nscoord(PRFloat64(rect.width) * 5.0/20.0);
nscoord six = nscoord(PRFloat64(rect.height) * 5.0/20.0);
nscoord eight = nscoord(PRFloat64(rect.height) * 7.0/20.0);
nscoord nine = nscoord(PRFloat64(rect.width) * 9.0/20.0);
nscoord ten = nscoord(PRFloat64(rect.height) * 9.0/20.0);
rect.x += three;
rect.y += nscoord(PRFloat64(rect.height) * 3.5 /20.0);
rect.width = nscoord(PRFloat64(rect.width) * 12.0/20.0);
rect.height = nscoord(PRFloat64(rect.height) * 12.0/20.0);
aRenderingContext.SetColor(NS_RGB(0,0,0));
nscoord onePixel = nscoord((appUnits+0.6F));
DrawScaledRect(aRenderingContext, rect, scale, appUnits);
nscoord x = rect.x;
nscoord y = rect.y;
if (mState) {
nscoord inc = nscoord(PRFloat64(rect.height) * 0.75/20.0);
nscoord yy = 0;
for (nscoord i=0;i<4;i++) {
DrawScaledLine(aRenderingContext, x+three, y+eight+yy, x+five, y+ten+yy, scale, appUnits, PR_FALSE); // top
DrawScaledLine(aRenderingContext, x+five, y+ten+yy, x+nine, y+six+yy, scale, appUnits, PR_FALSE); // top
//aRenderingContext.DrawLine(x+three, y+eight+yy, x+five, y+ten+yy);
//aRenderingContext.DrawLine(x+five, y+ten+yy, x+nine, y+six+yy);
yy += nscoord(scale);
}
}
NS_RELEASE(context);
return NS_OK;
}
BView *nsCheckButton::CreateBeOSView()
{
return mCheckBox = new nsCheckBoxBeOS(this, BRect(0, 0, 0, 0), "", "", NULL);
}
//-------------------------------------------------------------------------
// Sub-class of BeOS CheckBox
//-------------------------------------------------------------------------
nsCheckBoxBeOS::nsCheckBoxBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *aName, const char *aLabel, BMessage *aMessage,
uint32 aResizingMode, uint32 aFlags )
: BCheckBox( aFrame, aName, aLabel, aMessage, aResizingMode, aFlags ),
nsIWidgetStore( aWidgetWindow )
{
}

View File

@@ -1,77 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsCheckButton_h__
#define nsCheckButton_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsICheckButton.h"
#include <CheckBox.h>
/**
* Native Win32 Checkbox wrapper
*/
class nsCheckButton : public nsWindow,
public nsICheckButton
{
public:
nsCheckButton();
virtual ~nsCheckButton();
// nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// nsICheckButton part
NS_IMETHOD SetLabel(const nsString &aText);
NS_IMETHOD GetLabel(nsString &aBuffer);
NS_IMETHOD SetState(const PRBool aState);
NS_IMETHOD GetState(PRBool& aState);
NS_IMETHOD Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
virtual PRBool OnPaint(nsRect &r);
virtual PRBool OnResize(nsRect &aWindowRect);
protected:
PRBool mState;
virtual BView *CreateBeOSView();
BCheckBox *mCheckBox;
};
//
// A BCheckBox subclass
//
class nsCheckBoxBeOS : public BCheckBox, public nsIWidgetStore {
public:
nsCheckBoxBeOS( nsIWidget *aWidgetWindow, BRect aFrame, const char *aName,
const char *aLabel, BMessage *aMessage, uint32 aResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 aFlags = B_WILL_DRAW | B_NAVIGABLE );
};
#endif // nsCheckButton_h__

View File

@@ -1,523 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsClipboard.h"
#include "nsCOMPtr.h"
#include "nsIClipboardOwner.h"
#include "nsITransferable.h" // kTextMime
#include "nsIWidget.h"
#include "nsIServiceManager.h"
#include "nsWidgetsCID.h"
#include <View.h>
// The class statics:
BView *nsClipboard::sView = 0;
NS_IMPL_ADDREF_INHERITED(nsClipboard, nsBaseClipboard)
NS_IMPL_RELEASE_INHERITED(nsClipboard, nsBaseClipboard)
static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
#if defined(DEBUG_akkana) || defined(DEBUG_mcafee)
#define DEBUG_CLIPBOARD
#endif
//-------------------------------------------------------------------------
//
// nsClipboard constructor
//
//-------------------------------------------------------------------------
nsClipboard::nsClipboard() : nsBaseClipboard()
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::nsClipboard()\n");
#endif /* DEBUG_CLIPBOARD */
//NS_INIT_REFCNT();
mIgnoreEmptyNotification = PR_FALSE;
mClipboardOwner = nsnull;
mTransferable = nsnull;
// mSelectionData.data = nsnull;
// mSelectionData.length = 0;
}
//-------------------------------------------------------------------------
//
// nsClipboard destructor
//
//-------------------------------------------------------------------------
nsClipboard::~nsClipboard()
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::~nsClipboard()\n");
#endif /* DEBUG_CLIPBOARD */
// // Remove all our event handlers:
// if (sView &&
// gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == sWidget->window)
// gtk_selection_remove_all(sWidget);
//
// // free the selection data, if any
// if (mSelectionData.data != nsnull)
// g_free(mSelectionData.data);
}
/**
* @param aIID The name of the class implementing the method
* @param _classiiddef The name of the #define symbol that defines the IID
* for the class (e.g. NS_ISUPPORTS_IID)
*
*/
nsresult nsClipboard::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
nsresult rv = NS_NOINTERFACE;
if (aIID.Equals(nsIClipboard::GetIID())) {
*aInstancePtr = (void*) ((nsIClipboard*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return rv;
}
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 */
// // If we're changing from one widget to another
// // (shouldn't generally happen), clear the old event handlers:
// if (sView &&
// gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == sWidget->window)
// gtk_selection_remove_all(sWidget);
//
// sWidget = w;
//
// // Get the clipboard from the service manager.
// nsresult rv;
// NS_WITH_SERVICE(nsIClipboard, clipboard, kCClipboardCID, &rv);
//
// if (!NS_SUCCEEDED(rv)) {
// printf("Couldn't get clipboard service!\n");
// return;
// }
//
// // Handle selection requests if we called gtk_selection_add_target:
// gtk_signal_connect(GTK_OBJECT(sWidget), "selection_get",
// GTK_SIGNAL_FUNC(nsClipboard::SelectionGetCB),
// clipboard);
//
// // When someone else takes the selection away:
// gtk_signal_connect(GTK_OBJECT(sWidget), "selection_clear_event",
// GTK_SIGNAL_FUNC(nsClipboard::SelectionClearCB),
// clipboard);
//
// // Set up the paste handler:
// gtk_signal_connect(GTK_OBJECT(sWidget), "selection_received",
// GTK_SIGNAL_FUNC(nsClipboard::SelectionReceivedCB),
// clipboard);
//
//#if 0
// // Handle selection requests if we called gtk_selection_add_targets:
// gtk_signal_connect(GTK_OBJECT(sWidget), "selection_request_event",
// GTK_SIGNAL_FUNC(nsClipboard::SelectionRequestCB),
// clipboard);
//
// // Watch this, experimenting with Gtk :-)
// gtk_signal_connect(GTK_OBJECT(sWidget), "selection_notify_event",
// GTK_SIGNAL_FUNC(nsClipboard::SelectionNotifyCB),
// clipboard);
//#endif
//
// // Hmm, sometimes we need this, sometimes not. I'm not clear why.
// // See also long comment above on why we don't register a whole target list.
//
// // Register all the target types we handle:
// gtk_selection_add_target(sWidget,
// GDK_SELECTION_PRIMARY,
// GDK_SELECTION_TYPE_STRING,
// GDK_SELECTION_TYPE_STRING);
}
/**
*
*
*/
NS_IMETHODIMP nsClipboard::SetNativeClipboardData()
{
mIgnoreEmptyNotification = PR_TRUE;
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SetNativeClipboardData()\n");
#endif /* DEBUG_CLIPBOARD */
// make sure we have a good transferable
if (nsnull == mTransferable) {
printf(" SetNativeClipboardData: no transferable!\n");
return NS_ERROR_FAILURE;
}
// // If we're already the selection owner, don't need to do anything,
// // we'll already get the events:
// if (gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == sWidget->window)
// return NS_OK;
//
// // Clear the native clipboard
// if (sWidget &&
// gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == sWidget->window)
// gtk_selection_remove_all(sWidget);
//
//
// // register as the selection owner:
// gint have_selection =
// gtk_selection_owner_set(sWidget,
// GDK_SELECTION_PRIMARY,
// GDK_CURRENT_TIME);
// if (have_selection == 0)
// return NS_ERROR_FAILURE;
mIgnoreEmptyNotification = PR_FALSE;
return NS_OK;
}
//
// The blocking Paste routine
//
NS_IMETHODIMP
nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable)
{
nsresult rv = NS_OK;
#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;
}
// Dunno why we need to do this, copying the win32 code ...
nsCOMPtr<nsITransferable> trans = do_QueryInterface(aTransferable);
if (!trans)
return rv;
// //
// // We can't call the copy callback when we're blocking on the paste callback;
// // so if this app is already the selection owner, we need to copy our own
// // data without going through the X server.
// //
// if (gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == sWidget->window)
// {
// // XXX only support text/plain for now
// nsAutoString dataFlavor(kTextMime);
//
// // Get data out of our existing transferable.
// void *clipboardData;
// PRUint32 dataLength;
// rv = mTransferable->GetTransferData(&dataFlavor,
// &clipboardData,
// &dataLength);
// if (NS_SUCCEEDED(rv))
// rv = trans->SetTransferData(&dataFlavor,
// clipboardData, dataLength);
// return rv;
// }
//
//#define ONLY_SUPPORT_PLAIN_TEXT 1
//#ifdef ONLY_SUPPORT_PLAIN_TEXT
// gtk_selection_convert(sWidget, GDK_SELECTION_PRIMARY,
// GDK_SELECTION_TYPE_STRING, GDK_CURRENT_TIME);
// // Tried to use straight Xlib call but this would need more work:
// //XConvertSelection(GDK_WINDOW_XDISPLAY(sWidget->window),
// // XA_PRIMARY, XA_STRING, gdk_selection_property,
// // GDK_WINDOW_XWINDOW(sWidget->window), GDK_CURRENT_TIME);
//
//#else /* ONLY_SUPPORT_PLAIN_TEXT */
// //
// // XXX This code isn't implemented for Unix yet!
// // Instead of SetTransferData it will have to call gtk_selection_convert.
// //
//
// // Get the transferable list of data flavors
// nsVoidArray * dfList;
// aTransferable->GetTransferDataFlavors(&dfList);
//
// // Walk through flavors and see which flavor matches the one being pasted:
// PRUint32 i;
// PRUint32 cnt = 0;
// nsresult rv = dfList->Count(&cnt);
// NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
// for (i=0;i<cnt;i++) {
// nsString * df = (nsString *)dfList->ElementAt(i);
// if (nsnull != df) {
// UINT format = GetFormat(*df);
//
// void * data;
// PRUint32 dataLen;
//
// if (nsnull != aDataObject) {
// res = GetNativeDataOffClipboard(aDataObject, format, &data, &dataLen);
// if (NS_OK == res) {
// trans->SetTransferData(df, data, dataLen);
// }
// } else if (nsnull != aWindow) {
// res = GetNativeDataOffClipboard(aWindow, format, &data, &dataLen);
// if (NS_OK == res) {
// trans->SetTransferData(df, data, dataLen);
// }
// }
// }
// }
//#endif /* ONLY_SUPPORT_PLAIN_TEXT */
//
// //
// // We've told X what type to send, and we just have to wait
// // for the callback saying that the data have been transferred.
// //
//
// // Set a flag saying that we're blocking waiting for the callback:
// mBlocking = PR_TRUE;
//#ifdef DEBUG_CLIPBOARD
// printf("Waiting for the callback\n");
//#endif /* DEBUG_CLIPBOARD */
//
// // Now we need to wait until the callback comes in ...
// // i is in case we get a runaway (yuck).
// for (int i=0; mBlocking == PR_TRUE && i < 10000; ++i)
// {
// gtk_main_iteration_do(PR_TRUE);
// }
//
//#ifdef DEBUG_CLIPBOARD
// printf("Got the callback: '%s', %d\n",
// mSelectionData.data, mSelectionData.length);
//#endif /* DEBUG_CLIPBOARD */
//
// // We're back from the callback, no longer blocking:
// mBlocking = PR_FALSE;
//
// //
// // Now we have data in mSelectionData.data.
// // We just have to copy it to the transferable.
// //
// nsAutoString dataFlavor(kTextMime);
// trans->SetTransferData(&dataFlavor, mSelectionData.data, mSelectionData.length);
//
// // Can't free the selection data -- the transferable just saves a pointer.
// // But the transferable is responsible for freeing it, so we have to
// // consider it freed now:
// //g_free(mSelectionData.data);
// mSelectionData.data = nsnull;
// mSelectionData.length = 0;
return NS_OK;
}
//
// Called when the data from a paste comes in:
//
//void
//nsClipboard::SelectionReceivedCB (GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData)
//{
//#ifdef DEBUG_CLIPBOARD
// printf(" nsClipboard::SelectionReceivedCB\n");
//#endif /* DEBUG_CLIPBOARD */
//
// // ARGHH! GTK doesn't pass the arg to the callback, so we can't
// // get "this" back! Until we solve this, get it from the service mgr:
// nsresult rv;
// NS_WITH_SERVICE(nsIClipboard, iclipboard, kCClipboardCID, &rv);
//
// if (NS_FAILED(rv)) {
// printf("Couldn't get clipboard service!\n");
// return;
// }
// nsClipboard* clipboard = (nsClipboard*)iclipboard;
// if (!clipboard) {
// printf("couldn't convert nsIClipboard to nsClipboard\n");
// return;
// }
//
// clipboard->SelectionReceiver(aWidget, aSelectionData);
//}
//
//void
//nsClipboard::SelectionReceiver (GtkWidget *aWidget,
// GtkSelectionData *aSelectionData)
//{
// mBlocking = PR_FALSE;
//
// if (aSelectionData->length < 0)
// {
// printf("Error retrieving selection: length was %d\n",
// aSelectionData->length);
// return;
// }
//
// switch (aSelectionData->type)
// {
// case GDK_SELECTION_TYPE_STRING:
// mSelectionData = *aSelectionData;
// mSelectionData.data = g_new(guchar, aSelectionData->length + 1);
// memcpy(mSelectionData.data,
// aSelectionData->data, aSelectionData->length);
// // Null terminate in case anyone cares,
// // and so we can print the string for debugging:
// mSelectionData.data[aSelectionData->length] = '\0';
// mSelectionData.length = aSelectionData->length;
// return;
//
// default:
// printf("Can't convert type %s (%ld) to string\n",
// gdk_atom_name (aSelectionData->type), aSelectionData->type);
// return;
// }
//}
//
/**
* No-op.
*
*/
NS_IMETHODIMP nsClipboard::ForceDataToClipboard()
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::ForceDataToClipboard()\n");
#endif /* DEBUG_CLIPBOARD */
// make sure we have a good transferable
if (nsnull == mTransferable) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
//
//// This is the callback which is called when another app
//// requests the selection.
////
//void nsClipboard::SelectionGetCB(GtkWidget *widget,
// GtkSelectionData *aSelectionData,
// guint /*info*/,
// guint /*time*/,
// gpointer aData)
//{
//#ifdef DEBUG_CLIPBOARD
// printf(" nsClipboard::SelectionGetCB\n");
//#endif /* DEBUG_CLIPBOARD */
//
// nsClipboard *clipboard = (nsClipboard *)aData;
//
// void *clipboardData;
// PRUint32 dataLength;
// nsresult rv;
//
// // Make sure we have a transferable:
// if (!clipboard->mTransferable) {
// printf("Clipboard has no transferable!\n");
// return;
// }
//
// // XXX hack, string-only for now.
// // Create string data-flavor.
// nsString dataFlavor (kTextMime);
//
// // Get data out of transferable.
// rv = clipboard->mTransferable->GetTransferData(&dataFlavor,
// &clipboardData,
// &dataLength);
//
// // Currently we only offer the data in GDK_SELECTION_TYPE_STRING format.
// if (NS_SUCCEEDED(rv) && clipboardData && dataLength > 0) {
// gtk_selection_data_set(aSelectionData,
// GDK_SELECTION_TYPE_STRING, 8,
// (unsigned char *)clipboardData,
// dataLength);
// }
// else
// printf("Transferable didn't support the data flavor\n");
//}
//
//
//
//// Called when another app requests selection ownership:
//void nsClipboard::SelectionClearCB(GtkWidget *widget,
// GdkEventSelection *event,
// gpointer data)
//{
//#ifdef DEBUG_CLIPBOARD
// printf(" nsClipboard::SelectionClearCB\n");
//#endif /* DEBUG_CLIPBOARD */
//}
//
//
//// The routine called when another app asks for the content of the selection
//void
//nsClipboard::SelectionRequestCB (GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData)
//{
//#ifdef DEBUG_CLIPBOARD
// printf(" nsClipboard::SelectionRequestCB\n");
//#endif /* DEBUG_CLIPBOARD */
//}
//
//void
//nsClipboard::SelectionNotifyCB (GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData)
//{
//#ifdef DEBUG_CLIPBOARD
// printf(" nsClipboard::SelectionNotifyCB\n");
//#endif /* DEBUG_CLIPBOARD */
//}

View File

@@ -1,88 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsClipboard_h__
#define nsClipboard_h__
#include "nsBaseClipboard.h"
#include <Clipboard.h>
class nsITransferable;
class nsIClipboardOwner;
class nsIWidget;
/**
* Native BeOS Clipboard wrapper
*/
class nsClipboard : public nsBaseClipboard
{
public:
nsClipboard();
virtual ~nsClipboard();
//nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIClipboard
NS_IMETHOD ForceDataToClipboard();
static void SetTopLevelView(BView *v);
protected:
NS_IMETHOD SetNativeClipboardData();
NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable);
PRBool mIgnoreEmptyNotification;
static BView *sView;
// // Used for communicating pasted data
// // from the asynchronous X routines back to a blocking paste:
// GtkSelectionData mSelectionData;
// PRBool mBlocking;
//
// void SelectionReceiver(GtkWidget *aWidget,
// GtkSelectionData *aSelectionData);
//
// static void SelectionGetCB(GtkWidget *widget,
// GtkSelectionData *selection_data,
// guint /*info*/,
// guint /*time*/,
// gpointer data);
//
// static void SelectionClearCB(GtkWidget *widget,
// GdkEventSelection *event,
// gpointer data );
//
// static void SelectionRequestCB(GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData);
//
// static void SelectionReceivedCB(GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData);
//
// static void SelectionNotifyCB(GtkWidget *aWidget,
// GtkSelectionData *aSelectionData,
// gpointer aData);
};
#endif // nsClipboard_h__

View File

@@ -1,380 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsComboBox.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
#include "nsIComponentManager.h"
#include "nsIDeviceContext.h"
#include "nsIFontMetrics.h"
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
NS_IMPL_ADDREF(nsComboBox)
NS_IMPL_RELEASE(nsComboBox)
//-------------------------------------------------------------------------
//
// nsComboBox constructor
//
//-------------------------------------------------------------------------
nsComboBox::nsComboBox() : nsWindow(), nsIListWidget(), nsIComboBox()
{
NS_INIT_REFCNT();
mBackground = NS_RGB(124, 124, 124);
mDropDownHeight = 60; // Default to 60 pixels for drop-down list height
}
//-------------------------------------------------------------------------
//
// destructor
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
{
if(mMenuField && mMenuField->LockLooper())
{
NS_ALLOC_STR_BUF(val, aItem, 256);
mMenuField->Menu()->AddItem(new BMenuItem(val, 0), aPosition);
NS_FREE_STR_BUF(val);
mMenuField->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Finds an item at a postion
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::FindItem(nsString &aItem, PRInt32 aStartPos)
{
#if 0
NS_ALLOC_STR_BUF(val, aItem, 256);
int index = ::SendMessage(mWnd, CB_FINDSTRINGEXACT, (int)aStartPos, (LPARAM)(LPCTSTR)val);
NS_FREE_STR_BUF(val);
return index;
#endif
printf("nsListBox::FindItem not implemented\n");
return -1;
}
//-------------------------------------------------------------------------
//
// CountItems - Get Item Count
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetItemCount()
{
PRInt32 result = 0;
if(mMenuField && mMenuField->LockLooper())
{
result = mMenuField->Menu()->CountItems();
mMenuField->UnlockLooper();
}
return result;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsComboBox::RemoveItemAt(PRInt32 aPosition)
{
if(mMenuField && mMenuField->LockLooper())
{
BMenuItem *it = mMenuField->Menu()->RemoveItem(aPosition);
delete it;
mMenuField->UnlockLooper();
return it ? PR_TRUE : PR_FALSE;
}
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsComboBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
{
PRBool result = PR_FALSE;
anItem.SetLength(0);
if(mMenuField && mMenuField->LockLooper())
{
BMenuItem *it = mMenuField->Menu()->ItemAt(aPosition);
anItem.Append(it->Label());
mMenuField->UnlockLooper();
result = PR_TRUE;
}
return result;
}
//-------------------------------------------------------------------------
//
// Gets the selected of selected item
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::GetSelectedItem(nsString& aItem)
{
GetItemAt(aItem, GetSelectedIndex());
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Gets the list of selected otems
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetSelectedIndex()
{
PRInt32 index = -1;
if(mMenuField && mMenuField->LockLooper())
{
BMenuItem *it = mMenuField->Menu()->FindMarked();
index = it ? mMenuField->Menu()->IndexOf(it) : -1;
mMenuField->UnlockLooper();
}
return index;
}
//-------------------------------------------------------------------------
//
// SelectItem
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::SelectItem(PRInt32 aPosition)
{
if(mMenuField && mMenuField->LockLooper())
{
BMenuItem *it = mMenuField->Menu()->ItemAt(aPosition);
if(it)
it->SetMarked(true);
mMenuField->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Deselect
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::Deselect()
{
if(mMenuField && mMenuField->LockLooper())
{
BMenuItem *it = mMenuField->Menu()->FindMarked();
if(it)
it->SetMarked(false);
mMenuField->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// destructor
//
//-------------------------------------------------------------------------
nsComboBox::~nsComboBox()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsComboBox::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
static NS_DEFINE_IID(kInsComboBoxIID, NS_ICOMBOBOX_IID);
static NS_DEFINE_IID(kInsListWidgetIID, NS_ILISTWIDGET_IID);
if (aIID.Equals(kInsComboBoxIID)) {
*aInstancePtr = (void*) ((nsIComboBox*)this);
NS_ADDREF_THIS();
return NS_OK;
}
else if (aIID.Equals(kInsListWidgetIID)) {
*aInstancePtr = (void*) ((nsIListWidget*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return nsWindow::QueryInterface(aIID,aInstancePtr);
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsComboBox::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsComboBox::OnPaint(nsRect &r)
{
return PR_FALSE;
}
PRBool nsComboBox::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Cache the drop down list height in mDropDownHeight
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::PreCreateWidget(nsWidgetInitData *aInitData)
{
nsComboBoxInitData* comboData = (nsComboBoxInitData*)aInitData;
mDropDownHeight = comboData->mDropDownHeight;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Modify the height passed to create and resize to be
// the combo box drop down list height. (Note: Windows uses
// the height of the window to specify the drop-down list size,
// not the height of combobox text area.
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetHeight(PRInt32 aProposedHeight)
{
return(mDropDownHeight);
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::GetBounds(nsRect &aRect)
{
#if 0
nsWindow::GetNonClientBounds(aRect);
#endif
printf("nsListBox::GetBounds not wrong\n"); // the following is just a placeholder
nsWindow::GetClientBounds(aRect);
return NS_OK;
}
/**
* Renders the TextWidget for Printing
*
**/
NS_METHOD nsComboBox::Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
nsBaseWidget::Paint(aRenderingContext, aDirtyRect);
/*nsRect rect;
GetBoundsAppUnits(rect, aTwipsConversion);
aRenderingContext.SetColor(NS_RGB(0,0,0));
nscolor bgColor = NS_RGB(255,255,255);
nscolor fgColor = NS_RGB(0,0,0);
nscolor hltColor = NS_RGB(240,240,240);
nscolor sdwColor = NS_RGB(128,128,128);
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground, fgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow, sdwColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DHighlight, hltColor);
}
nsIDeviceContext * context;
//nsDrawingSurface surface;
aRenderingContext.GetDeviceContext(context);
//context->GetDrawingSurface(aRenderingContext, surface);
//HDC the_hdc = ((nsDrawingSurfaceWin *)&surface)->mDC;
//::SendMessage(mWnd, WM_PAINT, (WPARAM)the_hdc, NULL);
// shrink by one pixel
nscoord onePixel = nscoord((aTwipsConversion+0.6F));
nscoord twoPixels = onePixel*2;
nsString text("(ComboBox)");
//GetSelectedItem(text);
aRenderingContext.SetColor(bgColor);
aRenderingContext.FillRect(rect);
aRenderingContext.SetColor(NS_RGB(0,0,0));
aRenderingContext.DrawRect(rect);
aRenderingContext.SetFont(*mFont);
nscoord textWidth;
nscoord textHeight;
aRenderingContext.GetWidth(text, textWidth);
nsIFontMetrics* metrics;
context->GetMetricsFor(*mFont, metrics);
metrics->GetMaxAscent(textHeight);
nscoord x = (twoPixels * 2) + rect.x;
nscoord y = ((rect.height - textHeight) / 2) + rect.y;
//aRenderingContext.DrawString(text, x, y);
*/
return NS_OK;
}
BView *nsComboBox::CreateBeOSView()
{
return mMenuField = new nsMenuFieldBeOS((nsIWidget *)this, BRect(0, 0, 0, 0), "");
}
//-------------------------------------------------------------------------
// Sub-class of BeOS MenuField
//-------------------------------------------------------------------------
nsMenuFieldBeOS::nsMenuFieldBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *aName, uint32 aResizingMode, uint32 aFlags )
: BMenuField( aFrame, aName, "", new BPopUpMenu(""), aResizingMode, aFlags ),
nsIWidgetStore( aWidgetWindow )
{
SetDivider(0);
}

View File

@@ -1,93 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsComboBox_h__
#define nsComboBox_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsIComboBox.h"
#include <MenuItem.h>
#include <PopUpMenu.h>
#include <MenuField.h>
/**
* Native Win32 Combobox wrapper
*/
class nsComboBox : public nsWindow,
public nsIListWidget,
public nsIComboBox
{
public:
nsComboBox();
~nsComboBox();
// nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// nsIWidget overrides
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
virtual PRBool OnPaint(nsRect &r);
virtual PRBool OnResize(nsRect &aWindowRect);
// nsIWidget
NS_IMETHOD GetBounds(nsRect &aRect);
// nsIComboBox interface
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition);
virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos);
virtual PRInt32 GetItemCount();
virtual PRBool RemoveItemAt(PRInt32 aPosition);
virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition);
NS_IMETHOD GetSelectedItem(nsString& aItem);
virtual PRInt32 GetSelectedIndex();
NS_IMETHOD SelectItem(PRInt32 aPosition);
NS_IMETHOD Deselect() ;
NS_IMETHOD Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aInitData);
protected:
// Modify the height passed to create and resize to be
// the combo box drop down list height.
PRInt32 GetHeight(PRInt32 aProposedHeight);
PRInt32 mDropDownHeight;
BView *CreateBeOSView();
BMenuField *mMenuField;
};
//
// A BMenuField subclass
//
class nsMenuFieldBeOS : public BMenuField, public nsIWidgetStore {
public:
nsMenuFieldBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *name, uint32 aResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 aFlags = B_WILL_DRAW | B_NAVIGABLE );
};
#endif // nsComboBox_h__

View File

@@ -1,165 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDialog.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsIAppShell.h"
#include "nsIFontMetrics.h"
#include "nsGUIEvent.h"
#include "nsIRenderingContext.h"
#include "nsIDeviceContext.h"
#include "nsRect.h"
#include "nsTransform2D.h"
#include "nsStringUtil.h"
#include "nsGfxCIID.h"
#include "resource.h"
NS_IMPL_ADDREF(nsDialog)
NS_IMPL_RELEASE(nsDialog)
//-------------------------------------------------------------------------
//
// nsDialog constructor
//
//-------------------------------------------------------------------------
nsDialog::nsDialog() : nsWindow(), nsIDialog()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//
//-------------------------------------------------------------------------
NS_METHOD nsDialog::Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
return nsWindow::Create(aParent,aRect,aHandleEventFunction,aContext,aAppShell,aToolkit,aInitData);
}
//-------------------------------------------------------------------------
//
// nsDialog destructor
//
//-------------------------------------------------------------------------
nsDialog::~nsDialog()
{
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsDialog::SetLabel(const nsString& aText)
{
#if 0
NS_ALLOC_STR_BUF(label, aText, 256);
VERIFY(::SetWindowText(mWnd, label));
NS_FREE_STR_BUF(label);
#endif
printf("nsDialog::SetLabel not implemented\n");
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsDialog::GetLabel(nsString& aBuffer)
{
#if 0
int actualSize = ::GetWindowTextLength(mWnd)+1;
NS_ALLOC_CHAR_BUF(label, 256, actualSize);
::GetWindowText(mWnd, label, actualSize);
aBuffer.SetLength(0);
aBuffer.Append(label);
NS_FREE_CHAR_BUF(label);
#endif
printf("nsDialog::SetLabel not implemented\n");
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsDialog::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWindow::QueryInterface(aIID, aInstancePtr);
static NS_DEFINE_IID(kInsDialogIID, NS_IDIALOG_IID);
if (result == NS_NOINTERFACE && aIID.Equals(kInsDialogIID)) {
*aInstancePtr = (void*) ((nsIDialog*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsDialog::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsDialog::OnPaint(nsRect &r)
{
return nsWindow::OnPaint(r);
}
PRBool nsDialog::OnResize(nsRect &aWindowRect)
{
return nsWindow::OnResize(aWindowRect);
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsDialog::GetBounds(nsRect &aRect)
{
return nsWindow::GetBounds(aRect);
}

View File

@@ -1,230 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDragService.h"
#include "nsITransferable.h"
#include "nsIServiceManager.h"
#include "nsWidgetsCID.h"
static NS_DEFINE_IID(kIDragServiceIID, NS_IDRAGSERVICE_IID);
static NS_DEFINE_CID(kCDragServiceCID, NS_DRAGSERVICE_CID);
// The class statics:
BView *nsDragService::sView = 0;
NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService)
NS_IMPL_RELEASE_INHERITED(nsDragService, nsBaseDragService)
//-------------------------------------------------------------------------
// static variables
//-------------------------------------------------------------------------
//static PRBool gHaveDrag = PR_FALSE;
//-------------------------------------------------------------------------
//
// DragService constructor
//
//-------------------------------------------------------------------------
nsDragService::nsDragService()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// DragService destructor
//
//-------------------------------------------------------------------------
nsDragService::~nsDragService()
{
}
/**
* @param aIID The name of the class implementing the method
* @param _classiiddef The name of the #define symbol that defines the IID
* for the class (e.g. NS_ISUPPORTS_IID)
*
*/
nsresult nsDragService::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
nsresult rv = NS_NOINTERFACE;
if (aIID.Equals(nsIDragService::GetIID())) {
*aInstancePtr = (void*) ((nsIDragService*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return rv;
}
//---------------------------------------------------------
NS_IMETHODIMP nsDragService::StartDragSession (nsITransferable * aTransferable, PRUint32 aActionType)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable,
PRUint32 aItemIndex)
{
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
void nsDragService::SetTopLevelView(BView *v)
{
printf(" nsDragService::SetTopLevelWidget\n");
// Don't set up any more event handlers if we're being called twice
// for the same toplevel widget
if (sView == v)
return;
sView = v;
// Get the DragService from the service manager.
nsresult rv;
NS_WITH_SERVICE(nsIDragService, dragService, kCDragServiceCID, &rv);
if (NS_FAILED(rv)) {
return;
}
#if 0
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_leave",
GTK_SIGNAL_FUNC (nsDragService::DragLeave), dragService);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_motion",
GTK_SIGNAL_FUNC (nsDragService::DragMotion), dragService);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_drop",
GTK_SIGNAL_FUNC (nsDragService::DragDrop), dragService);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_data_received",
GTK_SIGNAL_FUNC (nsDragService::DragDataReceived), dragService);
#endif
}
//-------------------------------------------------------------------------
//void
//nsDragService::DragLeave (GtkWidget *widget,
// GdkDragContext *context,
// guint time)
//{
// g_print("leave\n");
// //gHaveDrag = PR_FALSE;
//}
//
////-------------------------------------------------------------------------
//PRBool
//nsDragService::DragMotion(GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// guint time)
//{
// g_print("drag motion\n");
// GtkWidget *source_widget;
//
//#if 0
// if (!gHaveDrag) {
// gHaveDrag = PR_TRUE;
// }
//#endif
//
// source_widget = gtk_drag_get_source_widget (context);
// g_print("motion, source %s\n", source_widget ?
// gtk_type_name (GTK_OBJECT (source_widget)->klass->type) :
// "unknown");
//
// gdk_drag_status (context, context->suggested_action, time);
//
// return PR_TRUE;
//}
//
////-------------------------------------------------------------------------
//PRBool
//nsDragService::DragDrop(GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// guint time)
//{
// g_print("drop\n");
// //gHaveDrag = PR_FALSE;
//
// if (context->targets){
// gtk_drag_get_data (widget, context,
// GPOINTER_TO_INT (context->targets->data),
// time);
// return PR_TRUE;
// }
//
// return PR_FALSE;
//}
//
////-------------------------------------------------------------------------
//void
//nsDragService::DragDataReceived (GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// GtkSelectionData *data,
// guint info,
// guint time)
//{
// if ((data->length >= 0) && (data->format == 8)) {
// g_print ("Received \"%s\"\n", (gchar *)data->data);
// gtk_drag_finish (context, PR_TRUE, PR_FALSE, time);
// return;
// }
//
// gtk_drag_finish (context, PR_FALSE, PR_FALSE, time);
//}
//
////-------------------------------------------------------------------------
//void
//nsDragService::DragDataGet(GtkWidget *widget,
// GdkDragContext *context,
// GtkSelectionData *selection_data,
// guint info,
// guint time,
// gpointer data)
//{
// gtk_selection_data_set (selection_data,
// selection_data->target,
// 8, (guchar *)"I'm Data!", 9);
//}
//
////-------------------------------------------------------------------------
//void
//nsDragService::DragDataDelete(GtkWidget *widget,
// GdkDragContext *context,
// gpointer data)
//{
// g_print ("Delete the data!\n");
//}

View File

@@ -1,91 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsDragService_h__
#define nsDragService_h__
#include "nsBaseDragService.h"
#include <View.h>
/**
* Native BeOS DragService wrapper
*/
class nsDragService : public nsBaseDragService
{
public:
nsDragService();
virtual ~nsDragService();
//nsISupports
NS_DECL_ISUPPORTS_INHERITED
//nsIDragService
NS_IMETHOD StartDragSession (nsITransferable * aTransferable,
PRUint32 aActionType);
// Native Impl.
NS_IMETHOD GetData (nsITransferable * aTransferable, PRUint32 aItemIndex);
static void SetTopLevelView(BView *v);
static BView *sView;
protected:
static PRBool gHaveDrag;
// static void DragLeave(GtkWidget *widget,
// GdkDragContext *context,
// guint time);
//
// static PRBool DragMotion(GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// guint time);
//
// static PRBool DragDrop(GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// guint time);
//
// static void DragDataReceived(GtkWidget *widget,
// GdkDragContext *context,
// gint x,
// gint y,
// GtkSelectionData *data,
// guint info,
// guint time);
//
// static void DragDataGet(GtkWidget *widget,
// GdkDragContext *context,
// GtkSelectionData *selection_data,
// guint info,
// guint time,
// gpointer data);
//
// static void DragDataDelete(GtkWidget *widget,
// GdkDragContext *context,
// gpointer data);
};
#endif // nsDragService_h__

View File

@@ -1,251 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*-
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//#include "stdafx.h"
//#include "olebase.h"
//#include "idropsrc.h"
#include "nsDropTarget.h"
//#include "contndoc.h"
#include "stdio.h"
#include "nsIWidget.h"
#include "nsWindow.h"
//Don't forget to RegisterDragDrop and to
//CoLockObjectExternal.
//You must RevokeDragDrop before destroying this object
//
nsDropTarget::nsDropTarget(nsIWidget * aWindow)
{
printf("nsDropTarget::nsDropTarget\n");
m_refs = 0;
m_pWin = aWindow;
NS_ADDREF(aWindow);
}
//Destructor for nsDropTarget
//Doesn't do a whole lot!
//
nsDropTarget::~nsDropTarget()
{
printf("nsDropTarget::Drop\n");
;
}
//QueryInterface for IDropTarget
//Notice that this QueryInterface does not refer to another object's QueryInterface,
//this is a totally stand-alone separate object
//
STDMETHODIMP nsDropTarget::QueryInterface(REFIID riid, LPVOID FAR* ppv)
{
printf("nsDropTarget::QueryInterface\n");
if (riid == IID_IUnknown)
*ppv = this;
else if (riid == IID_IDropTarget)
*ppv = this;
else{
*ppv = NULL;
}
if (*ppv != NULL){
((LPUNKNOWN)(*ppv))->AddRef();
return NOERROR;
}
//If for some reason our constructor did not create the requested interface
//don't pass the NULL interface without telling the caller that we don't support
//the requested interface.
return ResultFromScode(E_NOINTERFACE);
}
//A private AddRef for IDropTarget
//
STDMETHODIMP_(ULONG) nsDropTarget::AddRef(void)
{
printf("nsDropTarget::AddRef\n");
return ++m_refs;
}
//A private Release for IDropTarget
//
STDMETHODIMP_(ULONG) nsDropTarget::Release(void)
{
printf("nsDropTarget::Release\n");
if(--m_refs == 0){
//And now we can delete this object
delete this;
}
return m_refs;
}
//
//This helper function tells us what the drag/drop effect would be at
//the point pointl. Since our object accepts being a drop target anywhere
//in the window, we will ignore pointl
//
DWORD nsDropTarget::FindDragDropEffect(DWORD grfKeyState, POINTL /* pointl */)
{
printf("nsDropTarget::FindDragDropEffect\n");
DWORD dwRet;
// no modifier -- DROPEFFECT_MOVE or source default
// SHIFT -- DROPEFFECT_MOVE
// CTRL -- DROPEFFECT_COPY
// CTRL-SHIFT -- DROPEFFECT_LINK
dwRet = 0;//OleStdGetDropEffect(grfKeyState);
if (dwRet == 0)
dwRet = DROPEFFECT_COPY;
return dwRet;
}
//Notification that a DropSource is over the current DropTarget
//
STDMETHODIMP nsDropTarget::DragEnter (LPDATAOBJECT pDataObj,
DWORD grfKeyState,
POINTL pointl,
LPDWORD pdwEffect)
{
printf("nsDropTarget::DragEnter\n");
*pdwEffect = FindDragDropEffect(grfKeyState, pointl);
return NOERROR;
}
//Provides user feedback when a DropSource is over a DropTarget
//
STDMETHODIMP nsDropTarget::DragOver (DWORD grfKeyState,
POINTL pointl,
LPDWORD pdwEffect)
{
printf("nsDropTarget::DragOver\n");
*pdwEffect = FindDragDropEffect(grfKeyState, pointl);
return NOERROR;
}
//The DropSource is leaving our target window
//so its cleanup time!!!
//
STDMETHODIMP nsDropTarget::DragLeave (void)
{
printf("nsDropTarget::DragLeave\n");
return NOERROR;
}
//Drops the DropSource
//
STDMETHODIMP nsDropTarget::Drop (LPDATAOBJECT pIDataObject,
DWORD grfKeyState,
POINTL pointl,
LPDWORD pdwEffect)
{
printf("nsDropTarget::Drop\n");
printf("pIDataObject 0x%x\n", pIDataObject);
pIDataObject->AddRef();
if (nsnull != m_pWin) {
nsEventStatus status;
nsDragDropEvent event;
((nsWindow *)m_pWin)->InitEvent(event, NS_DRAGDROP_EVENT);
event.mType = nsDragDropEventStatus_eDrop;
event.mIsFileURL = PR_FALSE;
event.mURL = nsnull;
m_pWin->DispatchEvent(&event, status);
}
//pdwEffect = FindDragDropEffect(grfKeyState, pointl);
if (pIDataObject != NULL) {
IDataObject * presistStorage;
//printf("QueryInterface for persist\n");
pIDataObject->QueryInterface(IID_IDataObject,(LPVOID *)&presistStorage);
//printf("Done QueryInterface for persist\n");
if (presistStorage != NULL) {
printf("$$$$$$$$$$$$$$$ Got it!\n");
FORMATETC pFE;
presistStorage->QueryGetData(&pFE);
pFE.tymed = TYMED_FILE;
STGMEDIUM pSTM;
HRESULT st = presistStorage->GetDataHere(&pFE, &pSTM);
printf("st 0x%X\n", st);
if (NOERROR != st) {
return FALSE;
}
//TYMED_STORAGE, TYMED_STREAM, TYMED_HGLOBAL, or TYMED_FILE
//printf("%s\n", pSTM.lpszFileName);
{
//HRESULT hr = pIDataObject->GetData(&pFE, &pSTM);
//printf("hr 0x%X\n", hr);
//if (NOERROR != hr) {
// return FALSE;
//}
const CLIPFORMAT format = pFE.cfFormat;
switch(format) {
case CF_BITMAP:
//hr = SetBitmap(*pFE, stm);
break;
case CF_DIB:
//hr = SetDib(*pFE, stm);
break;
case CF_TEXT:
//hr = SetText(*pFE, stm);
break;
case CF_METAFILEPICT:
//hr = SetMetafilePict(*pFE, stm);
break;
default:
//if (format == GetRcfFormat()) {
// hr = SetRcf(*pFE, stm);
//}
break;
}
//return (SUCCEEDED(hr));
}
} else {
printf("^^^^^^^^^^^^^^^^^ Didn't!\n");
}
}
/* if (m_pContainDoc->m_pOleSiteObject)
delete m_pContainDoc->m_pOleSiteObject;
m_pContainDoc->m_pOleSiteObject = new COleSiteObject(m_pContainDoc);
FORMATETC fmtetc;
fmtetc.cfFormat = NULL;
fmtetc.ptd = NULL;
fmtetc.lindex = -1;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.tymed = TYMED_NULL;
m_pContainDoc->m_pOleSiteObject->AddSiteFromData(m_pContainDoc,
pIDataObject,
&fmtetc);
*/
pIDataObject->Release();
DragLeave();
return NOERROR;
}

View File

@@ -1,277 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// Define so header files for openfilename are included
#ifdef WIN32_LEAN_AND_MEAN
#undef WIN32_LEAN_AND_MEAN
#endif
#include "nsFileWidget.h"
//NS_IMPL_ISUPPORTS(nsFileWidget, NS_IFILEWIDGET_IID)
NS_DEFINE_IID(kIFileWidgetIID, NS_IFILEWIDGET_IID);
NS_IMPL_ISUPPORTS(nsFileWidget, kIFileWidgetIID);
//-------------------------------------------------------------------------
//
// nsFileWidget constructor
//
//-------------------------------------------------------------------------
nsFileWidget::nsFileWidget() : nsIFileWidget()
{
NS_INIT_REFCNT();
// mWnd = NULL;
mNumberOfFilters = 0;
}
//-------------------------------------------------------------------------
//
// Show - Display the file dialog
//
//-------------------------------------------------------------------------
PRBool nsFileWidget::Show()
{
printf("nsFileWidget::Show not implemented\n");
#if 0
char fileBuffer[MAX_PATH+1] = "";
mDefault.ToCString(fileBuffer,MAX_PATH);
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
nsString filterList;
GetFilterListArray(filterList);
char *filterBuffer = filterList.ToNewCString();
char *title = mTitle.ToNewCString();
char *initialDir = mDisplayDirectory.ToNewCString();
if (mDisplayDirectory.Length() > 0) {
ofn.lpstrInitialDir = initialDir;
}
ofn.lpstrTitle = title;
ofn.lpstrFilter = filterBuffer;
ofn.nFilterIndex = 1;
ofn.hwndOwner = mWnd;
ofn.lpstrFile = fileBuffer;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_SHAREAWARE | OFN_LONGNAMES | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
PRBool result;
// Save current directory, so we can reset if it changes.
char* currentDirectory = new char[MAX_PATH+1];
VERIFY(::GetCurrentDirectory(MAX_PATH, currentDirectory) > 0);
if (mMode == eMode_load) {
result = GetOpenFileName(&ofn);
}
else if (mMode == eMode_save) {
result = GetSaveFileName(&ofn);
}
else {
NS_ASSERTION(0, "Only load and save are supported modes");
}
// Store the current directory in mDisplayDirectory
char* newCurrentDirectory = new char[MAX_PATH+1];
VERIFY(::GetCurrentDirectory(MAX_PATH, newCurrentDirectory) > 0);
mDisplayDirectory.SetLength(0);
mDisplayDirectory.Append(newCurrentDirectory);
delete newCurrentDirectory;
VERIFY(::SetCurrentDirectory(currentDirectory));
delete currentDirectory;
// Clean up filter buffers
delete filterBuffer;
delete title;
delete initialDir;
// Set user-selected location of file or directory
mFile.SetLength(0);
if (result == PR_TRUE) {
mFile.Append(fileBuffer);
}
return((PRBool)result);
#endif
return PR_TRUE;
}
//-------------------------------------------------------------------------
//
// Convert filter titles + filters into a Windows filter string
//
//-------------------------------------------------------------------------
void nsFileWidget::GetFilterListArray(nsString& aFilterList)
{
aFilterList.SetLength(0);
for (PRUint32 i = 0; i < mNumberOfFilters; i++) {
const nsString& title = mTitles[i];
const nsString& filter = mFilters[i];
aFilterList.Append(title);
aFilterList.Append('\0');
aFilterList.Append(filter);
aFilterList.Append('\0');
}
aFilterList.Append('\0');
}
//-------------------------------------------------------------------------
//
// Set the list of filters
//
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[])
{
mNumberOfFilters = aNumberOfFilters;
mTitles = aTitles;
mFilters = aFilters;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the file + path
//
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::GetFile(nsFileSpec& aFile)
{
aFile = mFile;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the file + path
//
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::SetDefaultString(const nsString& aString)
{
mDefault = aString;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the display directory
//
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::SetDisplayDirectory(const nsFileSpec& aDirectory)
{
mDisplayDirectory = aDirectory;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the display directory
//
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::GetDisplayDirectory(nsFileSpec& aDirectory)
{
aDirectory = mDisplayDirectory;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::Create(nsIWidget *aParent,
const nsString& aTitle,
nsFileDlgMode aMode,
nsIDeviceContext *aContext = nsnull,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
void *aInitData = nsnull)
{
// mWnd = (HWND) ((aParent) ? aParent->GetNativeData(NS_NATIVE_WINDOW) : 0);
mTitle.SetLength(0);
mTitle.Append(aTitle);
mMode = aMode;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsFileWidget destructor
//
//-------------------------------------------------------------------------
nsFileWidget::~nsFileWidget()
{
}
nsFileDlgResults nsFileWidget::GetFile(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec)
{
Create(aParent, promptString, eMode_load, nsnull, nsnull);
if (Show() == PR_TRUE)
{
GetFile(theFileSpec);
return nsFileDlgResults_OK;
}
return nsFileDlgResults_Cancel;
}
nsFileDlgResults nsFileWidget::GetFolder(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec)
{
Create(aParent, promptString, eMode_getfolder, nsnull, nsnull);
if (Show() == PR_TRUE)
{
GetFile(theFileSpec);
return nsFileDlgResults_OK;
}
return nsFileDlgResults_Cancel;
}
nsFileDlgResults nsFileWidget::PutFile(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec)
{
Create(aParent, promptString, eMode_save, nsnull, nsnull);
if (Show() == PR_TRUE)
{
GetFile(theFileSpec);
return nsFileDlgResults_OK;
}
return nsFileDlgResults_Cancel;
}
NS_METHOD nsFileWidget::GetSelectedType(PRInt16& theType)
{
theType = mSelectedType;
return NS_OK;
}

View File

@@ -1,94 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsFileWidget_h__
#define nsFileWidget_h__
#include "nsObject.h"
#include "nsToolkit.h"
#include "nsIWidget.h"
#include "nsIFileWidget.h"
/**
* Native Win32 FileSelector wrapper
*/
class nsFileWidget : public nsIFileWidget
{
public:
nsFileWidget();
virtual ~nsFileWidget();
NS_DECL_ISUPPORTS
PRBool OnPaint(nsRect &r);
// nsIWidget interface
NS_IMETHOD Create(nsIWidget *aParent,
const nsString& aTitle,
nsFileDlgMode aMode,
nsIDeviceContext *aContext = nsnull,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
void *aInitData = nsnull);
// nsIFileWidget part
virtual PRBool Show();
NS_IMETHOD GetFile(nsFileSpec& aFile);
NS_IMETHOD SetDefaultString(const nsString& aFile);
NS_IMETHOD SetFilterList(PRUint32 aNumberOfFilters,
const nsString aTitles[],
const nsString aFilters[]);
NS_IMETHOD GetDisplayDirectory(nsFileSpec& aDirectory);
NS_IMETHOD SetDisplayDirectory(const nsFileSpec& aDirectory);
virtual nsFileDlgResults GetFile(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec);
virtual nsFileDlgResults GetFolder(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec);
virtual nsFileDlgResults PutFile(nsIWidget *aParent,
const nsString &promptString,
nsFileSpec &theFileSpec);
NS_IMETHOD GetSelectedType(PRInt16& theType);
protected:
// HWND mWnd;
nsString mTitle;
nsFileDlgMode mMode;
nsString mFile;
PRUint32 mNumberOfFilters;
const nsString* mTitles;
const nsString* mFilters;
nsString mDefault;
nsFileSpec mDisplayDirectory;
PRInt16 mSelectedType;
void GetFilterListArray(nsString& aFilterList);
};
#endif // nsFileWidget_h__

View File

@@ -1,418 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsFontRetrieverService.h"
#include "nsIWidget.h"
#include <ctype.h>
#include "nsFont.h"
#include "nsVoidArray.h"
#include "nsFontSizeIterator.h"
NS_IMPL_ADDREF(nsFontRetrieverService)
NS_IMPL_RELEASE(nsFontRetrieverService)
//----------------------------------------------------------
nsFontRetrieverService::nsFontRetrieverService()
{
NS_INIT_REFCNT();
mFontList = nsnull;
mSizeIter = nsnull;
mNameIterInx = 0;
}
//----------------------------------------------------------
nsFontRetrieverService::~nsFontRetrieverService()
{
if (nsnull != mFontList) {
for (PRInt32 i=0;i<mFontList->Count();i++) {
FontInfo * font = (FontInfo *)mFontList->ElementAt(i);
if (font->mSizes) {
delete font->mSizes;
}
delete font;
}
delete mFontList;
}
NS_IF_RELEASE(mSizeIter);
}
/**
* @param aIID The name of the class implementing the method
* @param _classiiddef The name of the #define symbol that defines the IID
* for the class (e.g. NS_ISUPPORTS_IID)
*
*/
nsresult nsFontRetrieverService::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
nsresult rv = NS_NOINTERFACE;
if (aIID.Equals(nsIFontRetrieverService::GetIID())) {
*aInstancePtr = (void*) ((nsIFontRetrieverService*)this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIFontNameIterator::GetIID())) {
*aInstancePtr = (void*) ((nsIFontNameIterator*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return rv;
}
//----------------------------------------------------------
//-- nsIFontRetrieverService
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::CreateFontNameIterator( nsIFontNameIterator** aIterator )
{
if (nsnull == aIterator) {
return NS_ERROR_FAILURE;
}
if (nsnull == mFontList) {
LoadFontList();
}
*aIterator = this;
NS_ADDREF_THIS();
return NS_OK;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::CreateFontSizeIterator( const nsString & aFontName,
nsIFontSizeIterator** aIterator )
{
// save value in case someone externally is using it
PRInt32 saveIterInx = mNameIterInx;
PRBool found = PR_FALSE;
Reset();
do {
nsAutoString name;
Get(&name);
if (name.Equals(aFontName)) {
found = PR_TRUE;
break;
}
} while (Advance() == NS_OK);
if (found) {
if (nsnull == mSizeIter) {
mSizeIter = new nsFontSizeIterator();
}
NS_ASSERTION( nsnull != mSizeIter, "nsFontSizeIterator instance pointer is null");
*aIterator = (nsIFontSizeIterator *)mSizeIter;
NS_ADDREF(mSizeIter);
FontInfo * fontInfo = (FontInfo *)mFontList->ElementAt(mNameIterInx);
mSizeIter->SetFontInfo(fontInfo);
mNameIterInx = saveIterInx;
return NS_OK;
}
mNameIterInx = saveIterInx;
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------
//-- nsIFontNameIterator
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Reset()
{
mNameIterInx = 0;
return NS_OK;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Get( nsString* aFontName )
{
if (mNameIterInx < mFontList->Count()) {
FontInfo * fontInfo = (FontInfo *)mFontList->ElementAt(mNameIterInx);
*aFontName = fontInfo->mName;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Advance()
{
if (mNameIterInx < mFontList->Count()-1) {
mNameIterInx++;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
//------------------------------
static FontInfo * GetFontInfo(nsVoidArray * aFontList, char * aName)
{
nsAutoString name(aName);
PRInt32 i;
PRInt32 cnt = aFontList->Count();
for (i=0;i<cnt;i++) {
FontInfo * fontInfo = (FontInfo *)aFontList->ElementAt(i);
if (fontInfo->mName.Equals(name)) {
return fontInfo;
}
}
FontInfo * fontInfo = new FontInfo();
fontInfo->mName = aName;
//printf("Adding [%s]\n", aName);fflush(stdout);
fontInfo->mIsScalable = PR_FALSE; // X fonts aren't scalable right??
fontInfo->mSizes = nsnull;
aFontList->AppendElement(fontInfo);
return fontInfo;
}
//------------------------------
static void AddSizeToFontInfo(FontInfo * aFontInfo, PRInt32 aSize)
{
nsVoidArray * sizes;
if (nsnull == aFontInfo->mSizes) {
sizes = new nsVoidArray();
aFontInfo->mSizes = sizes;
} else {
sizes = aFontInfo->mSizes;
}
PRInt32 i;
PRInt32 cnt = sizes->Count();
for (i=0;i<cnt;i++) {
PRInt32 size = (int)sizes->ElementAt(i);
if (size == aSize) {
return;
}
}
sizes->AppendElement((void *)aSize);
}
//---------------------------------------------------
// XXX - Hack - Parts of this will need to be reworked
//
// This method does brute force parcing for 4 different formats:
//
// 1) The format -*-*-*-*-*-* etc.
// -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-8
//
// 2) Name-size format
// lucidasans-10
//
// 3) Name-style-size
// lucidasans-bold-10
//
// 4) Name only (implicit size)
// 6x13
//
//--------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::LoadFontList()
{
// char * pattern = "*";
// int nnames = 1024;
//
// int available = nnames+1;
// int i;
// char **fonts;
// XFontStruct *info;
//
// if (nsnull == mFontList) {
// mFontList = new nsVoidArray();
// if (nsnull == mFontList) {
// return NS_ERROR_FAILURE;
// }
// }
//
// /* Get list of fonts matching pattern */
// for (;;) {
// // the following line is VERY slow to return
// fonts = XListFontsWithInfo(GDK_DISPLAY(), pattern, nnames,
// &available, &info);
// if (fonts == NULL || available < nnames)
// break;
//
// XFreeFontInfo(fonts, info, available);
// nnames = available * 2;
// }
//
// if (fonts == NULL) {
// fprintf(stderr, "pattern \"%s\" unmatched\n", pattern);
// return NS_ERROR_FAILURE;
// }
//
//#if 0 // debug
// // print out all the retrieved fonts
// printf("-----------------------------\n");
// for (i=0; i<available; i++) {
// printf("[%s]i\n", fonts[i]);
// }
// printf("-----------------------------\n");
//#endif
//
// // this code assumes all like fonts are grouped together
// // currentName is the current name of the font we are gathering
// // sizes for, when the name changes we create a new FontInfo object
// // but it also takes into account fonts of similar names when it
// // goes to add then and disregards duplicates
// char buffer[1024];
// char currentName[1024];
// FontInfo * font = nsnull;
//
// currentName[0] = 0;
// for (i=0; i<available; i++) {
//
// // This is kind of lame, but it will have to do for now
// strcpy(buffer, fonts[i]);
//
// // Start by checking to see if the name begins with a dash
// char * ptr = buffer;
// if (buffer[0] == '-') { //Format #1
//
// PRInt32 cnt = 0;
// // skip first two '-'
// do {
// if (*ptr == '-') cnt++;
// ptr++;
// } while (cnt < 2);
//
// // find the dash at the end of the name
// char * end = strchr(ptr, '-');
// if (end) {
// *end = 0;
//
// // Check to see if we need to create a new FontInfo obj
// // and set the currentName var to this guys font name
// if (strcmp(currentName, ptr) || NULL == font) {
// font = GetFontInfo(mFontList, ptr);
// strcpy(currentName, ptr);
// }
// if (nsnull == font->mSizes) {
// font->mSizes = new nsVoidArray();
// }
// ptr = end+1; // skip past the dash that was set to zero
//
// cnt = 0;
// // now skip ahead 4 dashes
// do {
// if (*ptr == '-') cnt++;
// ptr++;
// } while (cnt < 4);
//
// // find the dash after the size
// end = strchr(ptr, '-');
//
// if (end) {
// *end = 0;
// PRInt32 size;
// sscanf(ptr, "%d", &size);
// AddSizeToFontInfo(font, size);
// }
// }
// } else { // formats 2,3,4
//
// // no leading dash means the start of the
// // buffer is the start of the name
// // this checks for a dash at the end of the font name
// // which means there is a size at the end
// char * end = strchr(buffer, '-');
// if (end) { // Format 2,3
// *end = 0;
// // Check to see if we need to create a new FontInfo obj
// // and set the currentName var to this guys font name
// if (strcmp(currentName, buffer) || NULL == font) {
// font = GetFontInfo(mFontList, buffer);
// strcpy(currentName, buffer);
// }
// end++; // advance past the dash
// // check to see if we have a number
// ptr = end;
// if (isalpha(*ptr)) { // Format 3
// // skip until next dash
// end = strchr(ptr, '-');
// if (end) {
// *end = 0;
// ptr = end+1;
// }
// }
// PRInt32 size;
// // yes, it has a dash at the end so it must have the size
// // check to see if the size is terminated by a dash
// // it shouldn't be
// char * end2 = strchr(ptr, '-');
// if (end2) *end2 = 0; // put terminator at the dash
// sscanf(end, "%d", &size);
// AddSizeToFontInfo(font, size);
//
// } else { // Format #4
// // The font has an implicit size,
// // so there is nothing to parse for size
// // so we can't really do much here
// // Check to see if we need to create a new FontInfo obj
// // and set the currentName var to this guys font name
// if (strcmp(currentName, buffer) || NULL == font) {
// font = GetFontInfo(mFontList, buffer);
// strcpy(currentName, buffer);
// }
// }
// }
//
// }
//
// XFreeFontInfo(fonts, info, available);
return NS_OK;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::IsFontScalable(const nsString & aFontName,
PRBool* aResult )
{
// save value in case someone externally is using it
PRInt32 saveIterInx = mNameIterInx;
PRBool found = PR_FALSE;
Reset();
do {
nsAutoString name;
Get(&name);
if (name.Equals(aFontName)) {
found = PR_TRUE;
break;
}
} while (Advance() == NS_OK);
if (found) {
FontInfo * fontInfo = (FontInfo *)mFontList->ElementAt(mNameIterInx);
*aResult = fontInfo->mIsScalable;
mNameIterInx = saveIterInx;
return NS_OK;
}
mNameIterInx = saveIterInx;
return NS_ERROR_FAILURE;
}

View File

@@ -1,60 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef __nsFontRetrieverService
#define __nsFontRetrieverService
#include "nsIFontRetrieverService.h"
#include "nsIFontNameIterator.h"
class nsVoidArray;
class nsFontSizeIterator;
class nsFontRetrieverService: public nsIFontRetrieverService,
public nsIFontNameIterator {
public:
nsFontRetrieverService();
virtual ~nsFontRetrieverService();
NS_DECL_ISUPPORTS
// nsIFontRetrieverService
NS_IMETHOD CreateFontNameIterator( nsIFontNameIterator** aIterator );
NS_IMETHOD CreateFontSizeIterator( const nsString & aFontName, nsIFontSizeIterator** aIterator );
NS_IMETHOD IsFontScalable( const nsString & aFontName, PRBool* aResult );
// nsIFontNameIterator
NS_IMETHOD Reset();
NS_IMETHOD Get( nsString* aFontName );
NS_IMETHOD Advance();
protected:
NS_IMETHOD LoadFontList();
nsVoidArray * mFontList;
PRInt32 mNameIterInx;
nsFontSizeIterator * mSizeIter;
};
#endif

View File

@@ -1,84 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsFontSizeIterator.h"
#include "nsFont.h"
#include "nsVoidArray.h"
NS_IMPL_ADDREF(nsFontSizeIterator)
NS_IMPL_RELEASE(nsFontSizeIterator)
NS_IMPL_QUERY_INTERFACE(nsFontSizeIterator, nsIFontSizeIterator::GetIID())
//----------------------------------------------------------
nsFontSizeIterator::nsFontSizeIterator()
{
NS_INIT_REFCNT();
mFontInfo = nsnull;
mSizeIterInx = 0;
}
//----------------------------------------------------------
nsFontSizeIterator::~nsFontSizeIterator()
{
}
///----------------------------------------------------------
//-- nsIFontNameIterator
//----------------------------------------------------------
NS_IMETHODIMP nsFontSizeIterator::Reset()
{
mSizeIterInx = 0;
return NS_OK;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontSizeIterator::Get( double* aFontSize )
{
if (nsnull != mFontInfo->mSizes &&
mFontInfo->mSizes->Count() > 0 &&
mSizeIterInx < mFontInfo->mSizes->Count()) {
PRUint32 size = (PRUint32)mFontInfo->mSizes->ElementAt(mSizeIterInx);
*aFontSize = (double)size;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontSizeIterator::Advance()
{
if (nsnull != mFontInfo->mSizes &&
mFontInfo->mSizes->Count() > 0 &&
mSizeIterInx < mFontInfo->mSizes->Count()-2) {
mSizeIterInx++;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontSizeIterator::SetFontInfo( FontInfo * aFontInfo )
{
mFontInfo = aFontInfo;
return NS_OK;
}

View File

@@ -1,55 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef __nsFontSizeIterator
#define __nsFontSizeIterator
#include "nsIFontSizeIterator.h"
#include "nsString.h"
class nsVoidArray;
typedef struct {
nsString mName;
PRBool mIsScalable;
nsVoidArray * mSizes;
} FontInfo;
class nsFontSizeIterator: public nsIFontSizeIterator {
public:
nsFontSizeIterator();
virtual ~nsFontSizeIterator();
NS_DECL_ISUPPORTS
// nsIFontSizeIterator
NS_IMETHOD Reset();
NS_IMETHOD Get( double* aFontSize );
NS_IMETHOD Advance();
// Native impl
NS_IMETHOD SetFontInfo( FontInfo * aFontInfo );
protected:
FontInfo * mFontInfo;
PRInt32 mSizeIterInx; // current index of iter
};
#endif

View File

@@ -1,222 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsLabel.h"
#include "nsILabel.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsIFontMetrics.h"
#include "nsIDeviceContext.h"
NS_IMPL_ADDREF(nsLabel)
NS_IMPL_RELEASE(nsLabel)
//-------------------------------------------------------------------------
//
// nsLabel constructor
//
//-------------------------------------------------------------------------
nsLabel::nsLabel() : nsWindow(), nsILabel()
{
NS_INIT_REFCNT();
mAlignment = eAlign_Left;
}
//-------------------------------------------------------------------------
//
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::PreCreateWidget(nsWidgetInitData *aInitData)
{
if (nsnull != aInitData) {
nsLabelInitData* data = (nsLabelInitData *) aInitData;
mAlignment = data->mAlignment;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsLabel destructor
//
//-------------------------------------------------------------------------
nsLabel::~nsLabel()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsLabel::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWindow::QueryInterface(aIID, aInstancePtr);
static NS_DEFINE_IID(kILabelIID, NS_ILABEL_IID);
if (result == NS_NOINTERFACE && aIID.Equals(kILabelIID)) {
*aInstancePtr = (void*) ((nsILabel*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::SetAlignment(nsLabelAlignment aAlignment)
{
mAlignment = aAlignment;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::SetLabel(const nsString& aText)
{
char label[256];
aText.ToCString(label, 256);
label[255] = '\0';
if(mStringView && mStringView->LockLooper())
{
mStringView->SetText(label);
mStringView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::GetLabel(nsString& aBuffer)
{
if(mStringView && mStringView->LockLooper())
{
aBuffer.SetLength(0);
aBuffer.Append(mStringView->Text());
mStringView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsLabel::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsLabel::OnPaint(nsRect &r)
{
//printf("** nsLabel::OnPaint **\n");
return PR_FALSE;
}
PRBool nsLabel::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::GetBounds(nsRect &aRect)
{
return nsWindow::GetBounds(aRect);
}
//-------------------------------------------------------------------------
NS_METHOD nsLabel::GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight)
{
if (nsnull == mContext) {
return NS_ERROR_FAILURE;
}
//nsIFontMetrics * fm = GetFont();;
// mDeviceContext->GetMetricsFor(mFont, &fm);
nsIFontMetrics* metrics;
mContext->GetMetricsFor(*mFont, metrics);
nsString text;
GetLabel(text);
nsIRenderingContext *cx;
mContext->CreateRenderingContext(this, cx);
cx->SetFont(metrics);
nscoord string_height, string_width;
metrics->GetHeight(string_height);
cx->GetWidth(text, string_width);
NS_RELEASE(cx);
NS_RELEASE(metrics);
if (mPreferredWidth != 0) {
aWidth = mPreferredWidth;
} else {
aWidth = string_width+8;
}
if (mPreferredHeight != 0) {
aHeight = mPreferredHeight;
} else {
aHeight = string_height+8;
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsLabel::SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight)
{
mPreferredWidth = aWidth;
mPreferredHeight = aHeight;
return NS_OK;
}
BView *nsLabel::CreateBeOSView()
{
return mStringView = new nsStringViewBeOS(this, BRect(0, 0, 0, 0), "", "");
}
//-------------------------------------------------------------------------
// Sub-class of BeOS StringView
//-------------------------------------------------------------------------
nsStringViewBeOS::nsStringViewBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *aName, const char *text, uint32 aResizingMode, uint32 aFlags )
: BStringView( aFrame, aName, text, aResizingMode, aFlags ),
nsIWidgetStore( aWidgetWindow )
{
}

View File

@@ -1,78 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsLabel_h__
#define nsLabel_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsILabel.h"
#include <StringView.h>
/**
* Native Win32 Label wrapper
*/
class nsLabel : public nsWindow,
public nsILabel
{
public:
nsLabel();
virtual ~nsLabel();
// nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// nsILabel part
NS_IMETHOD SetLabel(const nsString &aText);
NS_IMETHOD GetLabel(nsString &aBuffer);
NS_IMETHOD SetAlignment(nsLabelAlignment aAlignment);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
virtual PRBool OnPaint(nsRect &r);
virtual PRBool OnResize(nsRect &aWindowRect);
NS_IMETHOD GetBounds(nsRect &aRect);
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aInitData);
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
protected:
nsLabelAlignment mAlignment;
BStringView *mStringView;
BView *CreateBeOSView();
};
//
// A BStringView subclass
//
class nsStringViewBeOS : public BStringView, public nsIWidgetStore {
public:
nsStringViewBeOS( nsIWidget *aWidgetWindow, BRect aFrame, const char *aName,
const char *text, uint32 aResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 aFlags = B_WILL_DRAW | B_NAVIGABLE );
};
#endif // nsLabel_h__

View File

@@ -1,389 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsListBox.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
NS_IMPL_ADDREF(nsListBox)
NS_IMPL_RELEASE(nsListBox)
//-------------------------------------------------------------------------
//
// initializer
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
{
mMultiSelect = aMultipleSelections;
if(mListView && mListView->LockLooper())
{
mListView->SetListType(aMultipleSelections ? B_MULTIPLE_SELECTION_LIST : B_SINGLE_SELECTION_LIST);
mListView->UnlockLooper();
}
return NS_OK;
}
NS_METHOD nsListBox::PreCreateWidget(nsWidgetInitData *aInitData)
{
if (nsnull != aInitData) {
nsListBoxInitData* data = (nsListBoxInitData *) aInitData;
mMultiSelect = data->mMultiSelect;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// destructor
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
{
if(mListView && mListView->LockLooper())
{
NS_ALLOC_STR_BUF(val, aItem, 256);
mListView->AddItem(new BStringItem(val), aPosition);
NS_FREE_STR_BUF(val);
mListView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Finds an item at a postion
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::FindItem(nsString &aItem, PRInt32 aStartPos)
{
#if 0
NS_ALLOC_STR_BUF(val, aItem, 256);
int index = ::SendMessage(mWnd, LB_FINDSTRINGEXACT, (int)aStartPos, (LPARAM)(LPCTSTR)val);
NS_FREE_STR_BUF(val);
return index;
#endif
printf("nsListBox::FindItem not implemented\n");
return -1;
}
//-------------------------------------------------------------------------
//
// CountItems - Get Item Count
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetItemCount()
{
PRInt32 result = 0;
if(mListView && mListView->LockLooper())
{
result = mListView->CountItems();
mListView->UnlockLooper();
}
return result;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsListBox::RemoveItemAt(PRInt32 aPosition)
{
if(mListView && mListView->LockLooper())
{
BListItem *it = mListView->RemoveItem(aPosition);
delete it;
mListView->UnlockLooper();
return it ? PR_TRUE : PR_FALSE;
}
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
{
PRBool result = PR_FALSE;
anItem.SetLength(0);
if(mListView && mListView->LockLooper())
{
BListItem *it = mListView->ItemAt(aPosition);
BStringItem *str;
if((str = dynamic_cast<BStringItem *>(it)) != 0)
{
anItem.Append(str->Text());
result = PR_TRUE;
}
mListView->UnlockLooper();
}
return result;
}
//-------------------------------------------------------------------------
//
// Gets the selected of selected item
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::GetSelectedItem(nsString& aItem)
{
if (!mMultiSelect) {
GetItemAt(aItem, GetSelectedIndex());
} else {
NS_ASSERTION(0, "Multi selection list box does not support GetSelectedItem()");
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Gets the list of selected otems
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetSelectedIndex()
{
if (!mMultiSelect)
{
PRInt32 index = -1;
if(mListView && mListView->LockLooper())
{
index = mListView->CurrentSelection();
mListView->UnlockLooper();
}
return index;
} else {
NS_ASSERTION(0, "Multi selection list box does not support GetSelectedIndex()");
}
return 0;
}
//-------------------------------------------------------------------------
//
// SelectItem
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::SelectItem(PRInt32 aPosition)
{
if(mListView && mListView->LockLooper())
{
mListView->Select(aPosition);
mListView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// GetSelectedCount
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetSelectedCount()
{
if (!mMultiSelect) {
PRInt32 inx = GetSelectedIndex();
return (inx == -1? 0 : 1);
} else {
PRInt32 count = 0;
if(mListView && mListView->LockLooper())
{
int index = 0;
while((index = mListView->CurrentSelection(index)) != -1)
count++;
mListView->UnlockLooper();
}
return count;
}
}
//-------------------------------------------------------------------------
//
// GetSelectedIndices
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
{
if(mListView && mListView->LockLooper())
{
int index = 0;
for(int i = 0; i < aSize; i++)
{
if(index != -1)
index = mListView->CurrentSelection(index);
aIndices[i] = index;
}
mListView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// SetSelectedIndices
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
{
if(mListView && mListView->LockLooper())
{
mListView->Select(aIndices[0], false);
for(int i = 1; i < aSize; i++)
mListView->Select(aIndices[i], true);
mListView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Deselect
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::Deselect()
{
if(mListView && mListView->LockLooper())
{
mListView->DeselectAll();
mListView->UnlockLooper();
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsListBox constructor
//
//-------------------------------------------------------------------------
nsListBox::nsListBox() : nsWindow(), nsIListWidget(), nsIListBox()
{
NS_INIT_REFCNT();
mMultiSelect = PR_FALSE;
mBackground = NS_RGB(124, 124, 124);
}
//-------------------------------------------------------------------------
//
// nsListBox:: destructor
//
//-------------------------------------------------------------------------
nsListBox::~nsListBox()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsListBox::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWindow::QueryInterface(aIID, aInstancePtr);
static NS_DEFINE_IID(kInsListBoxIID, NS_ILISTBOX_IID);
static NS_DEFINE_IID(kInsListWidgetIID, NS_ILISTWIDGET_IID);
if (result == NS_NOINTERFACE) {
if (aIID.Equals(kInsListBoxIID)) {
*aInstancePtr = (void*) ((nsIListBox*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
else if (aIID.Equals(kInsListWidgetIID)) {
*aInstancePtr = (void*) ((nsIListWidget*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
}
return result;
}
//-------------------------------------------------------------------------
//
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
PRBool nsListBox::OnMove(PRInt32, PRInt32)
{
return PR_FALSE;
}
PRBool nsListBox::OnPaint(nsRect &r)
{
return PR_FALSE;
}
PRBool nsListBox::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Clear window before paint
//
//-------------------------------------------------------------------------
PRBool nsListBox::AutoErase()
{
return(PR_TRUE);
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsListBox::GetBounds(nsRect &aRect)
{
#if 0
nsWindow::GetNonClientBounds(aRect);
#endif
printf("nsListBox::GetBounds not wrong\n"); // the following is just a placeholder
nsWindow::GetClientBounds(aRect);
return NS_OK;
}
BView *nsListBox::CreateBeOSView()
{
return mListView = new nsListViewBeOS((nsIWidget *)this, BRect(0, 0, 0, 0), "");
}
//-------------------------------------------------------------------------
// Sub-class of BeOS ListView
//-------------------------------------------------------------------------
nsListViewBeOS::nsListViewBeOS( nsIWidget *aWidgetWindow, BRect aFrame,
const char *aName, uint32 aResizingMode, uint32 aFlags )
: BListView( aFrame, aName,
((nsListBox *)aWidgetWindow)->mMultiSelect ? B_MULTIPLE_SELECTION_LIST : B_SINGLE_SELECTION_LIST,
aResizingMode, aFlags ),
nsIWidgetStore( aWidgetWindow )
{
}

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