Compare commits

..

1784 Commits

Author SHA1 Message Date
blizzard%redhat.com
2ca39b9b17 merge from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53740 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-17 03:57:27 +00:00
blizzard%redhat.com
fe94a6ca17 merges from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53737 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-17 03:27:47 +00:00
blizzard%redhat.com
dbd81545d5 remove these files from the branch, they are elsewhere in head now...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53733 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-17 03:14:54 +00:00
blizzard%redhat.com
eae64955ac merge modal changes from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53660 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-16 16:15:13 +00:00
blizzard%redhat.com
ac2b83c0f5 merge IM fixes from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53656 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-16 16:08:54 +00:00
blizzard%redhat.com
4de4b9b262 merges from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53653 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-16 15:56:04 +00:00
(no author)
585367a7b8 This commit was manufactured by cvs2svn to create branch 'SUPERWIN'.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53594 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-16 01:52:21 +00:00
blizzard%redhat.com
8226158ae4 focus changes from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53447 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-14 04:34:41 +00:00
blizzard%redhat.com
9cb5b0bd0f don't clear the xlate queue for ConfigureEvents on shell windows since the xlate queue has nothing to do with that shell window...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53425 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-13 15:10:10 +00:00
blizzard%redhat.com
ac24bf46fe merges from head
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53408 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-13 04:55:21 +00:00
blizzard%redhat.com
feb3b49669 work around for lame NS_SIZE event problems...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53361 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 20:24:19 +00:00
blizzard%redhat.com
e4d84ceca8 use the external gtksuperwin library
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53360 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 20:14:52 +00:00
blizzard%redhat.com
63e9105b5f add gtksuperwin to the build list
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53359 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 20:13:40 +00:00
blizzard%redhat.com
21904a64db patch from claudius@netscape.com to make this build on platforms with picky c++ compilers
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53355 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 18:10:02 +00:00
blizzard%redhat.com
6d8df6d4e7 add a -lgtksuperwin for the viewer since it embeds a native widget into the layout
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53354 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 17:29:47 +00:00
blizzard%redhat.com
8f49d292ca merge in some of pav's IM changes...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53281 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 00:04:56 +00:00
pavlov%netscape.com
e1431cd937 fix loop in debugging code
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53251 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-11 22:03:47 +00:00
blizzard%redhat.com
d8ee1acce8 make sure that we do a gtk_style_attach() in the realize method so the style doesn't get destroyed early...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53241 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-11 21:39:27 +00:00
blizzard%redhat.com
db224b8d6e merge in clipboard changes. remove some more debugging spew.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53089 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-10 21:29:44 +00:00
blizzard%redhat.com
37106d7fc3 remove more debugging spew
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53088 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-10 21:05:38 +00:00
blizzard%redhat.com
0c074d2a55 remove debugging spew
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53086 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-10 19:35:01 +00:00
blizzard%redhat.com
7d47d3aace make sure to send focus in and focus out events properly when giving focus to a superwin.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53085 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-10 19:31:50 +00:00
blizzard%redhat.com
4d1a2e8639 merge the license whackage
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53020 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 23:06:12 +00:00
blizzard%redhat.com
8b6d035f17 add focus support
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53016 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 22:53:26 +00:00
blizzard%redhat.com
4d22490af1 fix warnings due to passing bad data to the debug code
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@53008 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 19:48:03 +00:00
blizzard%redhat.com
4a1d8f7401 fix bogus warnings for gtk_signal_emit_stop_by_name
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52997 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 17:20:22 +00:00
blizzard%redhat.com
3ed82d86a0 add nsWindow::SetCursor
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52996 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 17:10:22 +00:00
blizzard%redhat.com
e763644046 fix background colors on windows
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52995 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-09 17:03:43 +00:00
blizzard%redhat.com
e94c0535d1 add hacks for superwin
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52971 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 22:56:27 +00:00
blizzard%redhat.com
201eebe4ec add mozbox code
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52965 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 22:34:41 +00:00
blizzard%redhat.com
91802fc4cb add superwin code for mozbox
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52964 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 22:34:22 +00:00
pavlov%netscape.com
68a592d45f fix debugging stuff like flashing, etc
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52963 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 22:32:36 +00:00
blizzard%redhat.com
60c89eba4b export our gtk header files. we'll need them for embedding.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52953 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 21:52:35 +00:00
blizzard%redhat.com
ceecd95095 make sure that the child window uses the same destroy as the nsWindow class
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52950 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 21:40:54 +00:00
blizzard%redhat.com
220151a643 assert if we get passed bad data. this is for testing.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52944 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-08 16:11:10 +00:00
blizzard%redhat.com
35d00c2c83 only send resize events on windows that are toplevel or have been created with a native parent
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52930 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-07 19:31:15 +00:00
blizzard%redhat.com
dfccc12330 add nsWindow::SetBackgroundColor, fix a warning
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52923 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 20:39:28 +00:00
(no author)
3c0a628da5 This commit was manufactured by cvs2svn to create branch 'SUPERWIN'.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52913 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 03:43:57 +00:00
blizzard%redhat.com
e67e916ea6 turn off the backing store for now
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52889 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 00:30:53 +00:00
blizzard%redhat.com
2312b5fc11 fix problems with using nsWindow::WidgetToScreen with toplevel windows
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52863 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 21:37:52 +00:00
blizzard%redhat.com
fcb064c579 turn on backing store for the bin_window
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52856 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 16:39:20 +00:00
blizzard%redhat.com
72255234ea add expose event compression
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52854 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 15:58:56 +00:00
blizzard%redhat.com
2cff6771cb never assign a mozarea to mMozArea unless you own it.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52853 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 15:49:31 +00:00
pavlov%netscape.com
f16eb3c3d2 fix WidgetToScreen
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52850 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 06:05:37 +00:00
pavlov%netscape.com
cc5f4699b6 remove #ifdef GTK_FIXED crap. make USE_SUPERWIN default, and fix native system color stuff (to be in head soon)
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52845 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:45:52 +00:00
blizzard%redhat.com
8dbfb05c9f fix some refcounting problems with the superwin and mozarea
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52821 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 23:12:20 +00:00
blizzard%redhat.com
4f6c078a40 make sure to destroy the superwin when the object goes out of scope
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52806 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 21:51:50 +00:00
blizzard%redhat.com
f303b7b880 add queued drawing
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52803 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 21:16:21 +00:00
blizzard%redhat.com
d5d532bbdf make rollup events work.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52801 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:33:34 +00:00
blizzard%redhat.com
1e9545d94e scrolling added
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52797 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:06:53 +00:00
blizzard%redhat.com
bbaf2a8966 implement nsWindow::Resize and nsWindow::Move methods
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52772 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 03:25:04 +00:00
blizzard%redhat.com
4979b2734e first pass at getting superwin code to build. it will run now but doesn't have nsWindow::Move and nsWindow::Resize implemented...
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52747 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:07:52 +00:00
blizzard%redhat.com
0ba4ab32b2 fix some indenting issues
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52724 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 20:10:28 +00:00
blizzard%redhat.com
53df453f1a add gdk event handler
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52722 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 19:47:14 +00:00
blizzard%redhat.com
db90d4ddcf start adding glue code for events for the superwin and mozbox code. also, add the box and superwin as class members.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52721 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 18:58:37 +00:00
blizzard%redhat.com
24a4aec113 change all of the debugging calls to use GtkObject or GtkWidget
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52718 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 16:38:21 +00:00
blizzard%redhat.com
74599c2956 change all of the CreateNative calls to use GtkObject instead of GtkWidget
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52717 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 16:09:35 +00:00
(no author)
9b52dc355f This commit was manufactured by cvs2svn to create branch 'SUPERWIN'.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52698 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:34:51 +00:00
blizzard%redhat.com
1792ff0e46 start on the branch to get the superwin code to build.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52591 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:21:47 +00:00
(no author)
fb08d16e05 This commit was manufactured by cvs2svn to create branch 'SUPERWIN'.
git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52461 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:25:01 +00:00
pavlov%netscape.com
268235e424 break in the switch, don't fall through *doh* r=duncan@be.com
git-svn-id: svn://10.0.0.236/trunk@52460 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:25:00 +00:00
cls%seawood.org
6533b90ce6 Added detection for alphaev6. Submitted by Matt Wilson <msw@redhat.com>.
git-svn-id: svn://10.0.0.236/trunk@52459 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:24:16 +00:00
nhotta%netscape.com
a468c6983c Fixed a typo in the entity definition, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@52458 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:19:19 +00:00
tbogard%aol.net
0154b52329 Second phase of changing NS_ENSURE() to NS_ENSURE_TRUE() and NS_ENSURE_NOT() to NS_ENSURE_FALSE(). r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52457 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:18:52 +00:00
nisheeth%netscape.com
add2edbda0 r=pollmann. Check local DTD directory for dtd files and, if found, load them from there.
git-svn-id: svn://10.0.0.236/trunk@52456 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:16:37 +00:00
pavlov%netscape.com
59b22727bd added .cvsignore file r=slamm
git-svn-id: svn://10.0.0.236/trunk@52455 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:16:09 +00:00
waterson%netscape.com
410ac67f93 Add 'miscellaneous' debug prefs to house 'disable XUL cache' pref UI.
git-svn-id: svn://10.0.0.236/trunk@52454 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:14:50 +00:00
waterson%netscape.com
9ba00de102 Bug 15146. Brutal sharing, Phase III. Turn on protoype, script, and style sheet caching. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52453 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:14:07 +00:00
alecf%netscape.com
54bfc70eea cleanup NS_IMPL_MODULE and friends
- define new nsModuleComponentInfo and use it instead of components_t
- use size_t instead of unsigned int
- add some docs
- allow user to define own module name


git-svn-id: svn://10.0.0.236/trunk@52452 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:12:32 +00:00
danm%netscape.com
44d6b4c7e5 removing implementation of nsIShutdownListener. it was redundant, anyway. r:dp@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52451 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:10:35 +00:00
tbogard%aol.net
c98bf7e9a6 **Not hooked up to build** Implemented Repaint. Changed document to be a readonly attribute. Added a SetDocument that takes a contentType. Implemented this. Changed all the idl methods to be lower-case.
git-svn-id: svn://10.0.0.236/trunk@52450 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:04:25 +00:00
rogerl%netscape.com
81ef7e0434 Needed string parameter in order to pass type comparison correctly.
Added missing TITLE declaration.


git-svn-id: svn://10.0.0.236/trunk@52449 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:03:52 +00:00
rogerl%netscape.com
dff3a32176 Moved nested function out - new ECMA definition.
git-svn-id: svn://10.0.0.236/trunk@52448 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:02:55 +00:00
rogerl%netscape.com
ceaebd4804 Put test case in eval statement to catch error.
git-svn-id: svn://10.0.0.236/trunk@52447 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:02:03 +00:00
rogerl%netscape.com
a027094b30 Added missing TITLE declaration
git-svn-id: svn://10.0.0.236/trunk@52446 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:01:34 +00:00
troy%netscape.com
aa355b810b See if the Mac is any happier with this
git-svn-id: svn://10.0.0.236/trunk@52445 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 00:21:47 +00:00
varada%netscape.com
cc411daf35 removing unix line endings
git-svn-id: svn://10.0.0.236/trunk@52444 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:47:43 +00:00
dmose%mozilla.org
03ec794132 updated license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52443 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:56 +00:00
varada%netscape.com
9efe8d599f fix for bug#9097
git-svn-id: svn://10.0.0.236/trunk@52442 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:13 +00:00
valeski%netscape.com
9862db5a48 not in build. updating keyword protocol handler to use new api.
git-svn-id: svn://10.0.0.236/trunk@52441 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:05 +00:00
troy%netscape.com
c1c6ae68cd Changed GetFrameName() calls to use nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52440 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:29:27 +00:00
kipp%netscape.com
824e50d549 Fixed compilation bustage by using nsIFrameDebug to invoke list and regression data methods
git-svn-id: svn://10.0.0.236/trunk@52439 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:29:05 +00:00
troy%netscape.com
af506bd6c9 Temporary change
git-svn-id: svn://10.0.0.236/trunk@52438 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:21:20 +00:00
rogerl%netscape.com
5df87dc67e Belay that, the tests were fine, the code HAS changed.
git-svn-id: svn://10.0.0.236/trunk@52437 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:16:00 +00:00
troy%netscape.com
cf64589783 Fixed problem with GetFrameName() being defines in non-debug build
git-svn-id: svn://10.0.0.236/trunk@52436 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:12:32 +00:00
larryh%netscape.com
d3f1c46ba5 BugZilla 17558. Add PR_Open() PR_EXCL flag
git-svn-id: svn://10.0.0.236/trunk@52435 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:59:27 +00:00
kipp%netscape.com
d8d82e0637 r=rods; bug=17518; I updated the html.css file to select on 'a[href]' instead of 'a' so that the focus properties and related style properties would only apply to anchors with href's
git-svn-id: svn://10.0.0.236/trunk@52434 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:54:14 +00:00
tbogard%aol.net
94697e0452 Changed NS_ENSURE_NOT() to use NS_ENSURE_FALSE() per API change.
git-svn-id: svn://10.0.0.236/trunk@52433 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:54:06 +00:00
kipp%netscape.com
f8fb68c673 r=troy; fixed compiliation issue for debug builds
git-svn-id: svn://10.0.0.236/trunk@52432 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:45:20 +00:00
leaf%mozilla.org
368f25d7ee adding mozilla/uriloader for mscott
git-svn-id: svn://10.0.0.236/trunk@52431 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:43:22 +00:00
kipp%netscape.com
7ae532db2a r=troy; fixed bug 14982 - the problem was that empty continuations of an inline non-replaced element (e.g. 'span') were impact line-height calculations when they should effectively disappear
git-svn-id: svn://10.0.0.236/trunk@52430 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:38:17 +00:00
kipp%netscape.com
a98ac534c3 latest and greatest tests for block dom functions
git-svn-id: svn://10.0.0.236/trunk@52429 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:36:42 +00:00
akkana%netscape.com
1824e7ce91 Fix Sun build bustage: older gcc can't do nsCOMPtr on a forward type
git-svn-id: svn://10.0.0.236/trunk@52428 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:16:15 +00:00
troy%netscape.com
3513334988 Moved a bunch of stuff out to a nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52427 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:12:45 +00:00
dp%netscape.com
8a02a9884b Removing extra release happening on a service. NS_WITH_SERVICE() will
take care of this release.


git-svn-id: svn://10.0.0.236/trunk@52426 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:57:14 +00:00
akkana%netscape.com
0df1ff715c Formatting whitespace changes only
git-svn-id: svn://10.0.0.236/trunk@52425 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:53:50 +00:00
putterman%netscape.com
897d9e027c Release mNativeDragTarget to fix leaks. no bug. reviewed by rods.
git-svn-id: svn://10.0.0.236/trunk@52424 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:53:06 +00:00
sspitzer%netscape.com
07d441b61a fix for #16119. this variable is not defined out of the scope of the loop, so
it was undefined.


git-svn-id: svn://10.0.0.236/trunk@52423 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:51:16 +00:00
mscott%netscape.com
5492a19059 Don't build new uri idl interfaces in netwerk.
they've been moved to uriloader.


git-svn-id: svn://10.0.0.236/trunk@52422 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:49:55 +00:00
radha%netscape.com
d0a23025d8 Remove the extra AddRef to nsHistoryLayoutState. r=pollmann, bug #16496
git-svn-id: svn://10.0.0.236/trunk@52421 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:47:54 +00:00
mscott%netscape.com
e1c9192da5 remove these uri dispatching interfaces from netwerk.
they live in uriloader now.


git-svn-id: svn://10.0.0.236/trunk@52420 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:47:26 +00:00
alecf%netscape.com
a15001ef11 fix twisties in the thread pane and account manager by responding to GetTarget() along the child arcs like #child and #MessageChild bug #13551
r=scottip


git-svn-id: svn://10.0.0.236/trunk@52419 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:46:07 +00:00
mscott%netscape.com
099420f43e none of these interfaces were being used yet.
they've been moved into mozilla\uriloader.


git-svn-id: svn://10.0.0.236/trunk@52418 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:45:29 +00:00
tbogard%aol.net
ae3cd9e2ce Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52417 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:43:56 +00:00
dveditz%netscape.com
5ed2cd7fa7 taking a crack at some ports bustage. r=pnunn
git-svn-id: svn://10.0.0.236/trunk@52416 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:35:50 +00:00
akkana%netscape.com
9dd7ffd0ef 17275, 16285, 15204: Switch to using nsISaveAsCharset for both charset and entity conversion. r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52415 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:34:44 +00:00
tbogard%aol.net
46a7117699 Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52414 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:27:09 +00:00
tbogard%aol.net
8d4c0ac47e Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change.
git-svn-id: svn://10.0.0.236/trunk@52413 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:25:52 +00:00
tbogard%aol.net
87358978bd Changed NS_ASSERTION to use NS_WARN_IF_FALSE. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52412 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:24:24 +00:00
dp%netscape.com
ff9db70a07 Removing release on a service as this would be taken care by the
NS_WITH_SERVICE() macro. r=danm


git-svn-id: svn://10.0.0.236/trunk@52411 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:16:24 +00:00
Jerry.Kirk%Nexwarecorp.com
2bc6161677 Remove call to nsIThread::SetMainThread() and clean up things a bit.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52410 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:52:52 +00:00
warren%netscape.com
933e7aa1a8 Minor cleanup
git-svn-id: svn://10.0.0.236/trunk@52409 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:50:04 +00:00
warren%netscape.com
793d674760 Eliminating netwerk/util
git-svn-id: svn://10.0.0.236/trunk@52408 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:48:12 +00:00
valeski%netscape.com
42d0478ba8 removing early xpcom proxy release change from earlier in the weekend.
git-svn-id: svn://10.0.0.236/trunk@52407 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:37:13 +00:00
varada%netscape.com
bd12ec528f fix for bug #6568 - showing summary in the first page
git-svn-id: svn://10.0.0.236/trunk@52406 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:13:16 +00:00
idk%eng.sun.com
307fe1df58 fix for 17454
changed strncmp to PL_strncasecmp


git-svn-id: svn://10.0.0.236/trunk@52405 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:04:57 +00:00
tbogard%aol.net
e885439545 Changed some m_* to m*.
git-svn-id: svn://10.0.0.236/trunk@52404 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:57:15 +00:00
mscott%netscape.com
2a86ddb6f8 (not part of the seamonkey build)
top level Makefile for uriloader


git-svn-id: svn://10.0.0.236/trunk@52403 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:56:25 +00:00
mscott%netscape.com
cc0ac6a407 not part of the seamonkey build
add makefile for the uriloader\build directory.


git-svn-id: svn://10.0.0.236/trunk@52402 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:52:49 +00:00
mscott%netscape.com
4f15b3e7bd not part of the seamonkey build
add CID header file and uri loader module class.


git-svn-id: svn://10.0.0.236/trunk@52401 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:52:25 +00:00
mscott%netscape.com
9cbec3ba42 not part of the seamonkey build.
add top level makefile.win for uriloader.


git-svn-id: svn://10.0.0.236/trunk@52400 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:51:45 +00:00
mscott%netscape.com
604569330e not part of the seamonkey build
remove class id and progid from the interface


git-svn-id: svn://10.0.0.236/trunk@52399 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:51:05 +00:00
mscott%netscape.com
82bbc3b0eb (not part of the seamonkey build!)
export nsURIDispatcher.h


git-svn-id: svn://10.0.0.236/trunk@52398 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:49:09 +00:00
idk%eng.sun.com
b338802f73 fix for 17449
added checkings for NULL


git-svn-id: svn://10.0.0.236/trunk@52397 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:39:26 +00:00
varada%netscape.com
13b7afe705 fixes to bug 5434
git-svn-id: svn://10.0.0.236/trunk@52396 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:14:29 +00:00
varada%netscape.com
56c344a8d0 cleanup code for customizationlist
git-svn-id: svn://10.0.0.236/trunk@52395 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 18:10:26 +00:00
varada%netscape.com
fb8cb373a0 cleanup code for checklist
git-svn-id: svn://10.0.0.236/trunk@52394 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 18:09:31 +00:00
briano%netscape.com
e2c9ed766a Automated update
git-svn-id: svn://10.0.0.236/trunk@52393 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:45:17 +00:00
rods%netscape.com
23778b8c16 Check to see if the option being added has the "selected" property, if it
does then the list needs to be reinitialized.
r=dcone, bug #17519


git-svn-id: svn://10.0.0.236/trunk@52392 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:41:17 +00:00
kipp%netscape.com
bac454b0b5 Added address information to the dump content diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52391 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:38:05 +00:00
kipp%netscape.com
c6c74d8fe2 r=ftang (someday); fixed bug 17130 - the problem was that nbsp's were being mapped into spaces by the text-transformer which is normally good, but for the purposes of line-breaking look-ahead was bad. I added code to revert the post-transformed spaces into nbsp's before using the line-breaker
git-svn-id: svn://10.0.0.236/trunk@52390 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:36:02 +00:00
kipp%netscape.com
283a28a5d4 r=ftang (someday); fixed 17559 regression - there were a few cases where characters > 127 were leaking out without setting the mHasMultibyte flag that were triggering painting bugs on macs...
git-svn-id: svn://10.0.0.236/trunk@52389 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:32:37 +00:00
cls%seawood.org
9981b6e5e7 Tested various build options, marked some broken, unmarked others that have been fixed. Removed obsolete options.
git-svn-id: svn://10.0.0.236/trunk@52388 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:32:02 +00:00
kipp%netscape.com
2cabf1bf40 Disabled debug noise I accidently checked in (whoops!)
git-svn-id: svn://10.0.0.236/trunk@52387 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:31:04 +00:00
cls%seawood.org
aabaf48158 Remove the extra -D_XXX_SOURCE_ flags for Linux builds.
git-svn-id: svn://10.0.0.236/trunk@52386 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:29:31 +00:00
kipp%netscape.com
63ae90acca r=troy; reworked the way that blocks inside of inline elements are handled. It's all in the frame construction code now (bugs 15999, 16737)
git-svn-id: svn://10.0.0.236/trunk@52385 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:24:57 +00:00
kipp%netscape.com
333bf3d48a Added address information to the dump content diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52384 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:23:06 +00:00
kipp%netscape.com
e5672a7cbf Added another frame property
git-svn-id: svn://10.0.0.236/trunk@52383 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:22:25 +00:00
jfrancis%netscape.com
8ad4c60be3 fix for bugs: 16724, 16855; r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52382 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:15:56 +00:00
jfrancis%netscape.com
53c8075ee8 fixes for bugs: 16361,12253,15696,15734; r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52381 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:15:35 +00:00
dp%netscape.com
a1cbbe03aa Removing double check for failure. Checking for nsresult is sufficient.
git-svn-id: svn://10.0.0.236/trunk@52380 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 08:54:06 +00:00
tbogard%aol.net
188cbf9d0b Added some checks to verify calling of the nsIDocShellFile and nsIDocShellEdit functions.
git-svn-id: svn://10.0.0.236/trunk@52379 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:53:24 +00:00
tbogard%aol.net
1b8869ef46 Changed NS_ENSURE to be NS_ENSURE_TRUE.
git-svn-id: svn://10.0.0.236/trunk@52378 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:45:38 +00:00
tbogard%aol.net
e1325fa173 Changed NS_ENSURE and NS_ENSURE_NOT occurences to be NS_ENSURE_TRUE and NS_ENSURE_FALSE respectively.
git-svn-id: svn://10.0.0.236/trunk@52377 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:40:19 +00:00
tbogard%aol.net
e3a1567dcc Changed NS_ENSURE to be NS_ENSURE_TRUE. Also changed NS_ENSURE_NOT to be NS_ENSURE_FALSE. Left NS_ENSURE and NS_ENSURE_NOT, but they will soon be going away.
git-svn-id: svn://10.0.0.236/trunk@52376 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 06:59:16 +00:00
rpotts%netscape.com
6a0e6b0b2d bug #16418 (r=warren,gagan). When redirecting a URL only copy the Ref to the new URL (not the Param and Query).
git-svn-id: svn://10.0.0.236/trunk@52375 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 06:00:55 +00:00
dougt%netscape.com
908f338b00 Adding a set accessor to the permissions functions. Needed by the xpinstall
folks.


git-svn-id: svn://10.0.0.236/trunk@52374 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:44:56 +00:00
tbogard%aol.net
fe0b504eac Added comment around frame stuff to explain lack of ref-counting.
git-svn-id: svn://10.0.0.236/trunk@52373 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:03:03 +00:00
tbogard%aol.net
2766610a72 Implemented GetZoom and SetZoom. Removed some left over comment code.
git-svn-id: svn://10.0.0.236/trunk@52372 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:02:24 +00:00
troy%netscape.com
5143eb0b1d Added nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52371 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 03:34:43 +00:00
bienvenu%netscape.com
0828780018 fix updating of folders after imap/moves r=mscott bug 12491
git-svn-id: svn://10.0.0.236/trunk@52370 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 01:10:08 +00:00
bienvenu%netscape.com
b3ee9d6099 add support for pending counts for imap folders r=mscott
git-svn-id: svn://10.0.0.236/trunk@52369 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 01:06:29 +00:00
mscott%netscape.com
059b0b18ff remove shut down listener stuff.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52368 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:57:49 +00:00
mscott%netscape.com
c3e35b09e6 remove shutdown listener stuff.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52367 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:56:19 +00:00
mscott%netscape.com
3c8f842dd1 remove shutdown listener code.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52366 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:55:06 +00:00
tonyr%fbdesigns.com
f0bafa3901 Added Outlook mail and address book import functionality
git-svn-id: svn://10.0.0.236/trunk@52365 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:46:18 +00:00
bienvenu%netscape.com
90413c1803 add method to find out if folder is in open window r=putterman
git-svn-id: svn://10.0.0.236/trunk@52364 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 22:21:55 +00:00
tbogard%aol.net
86bf83a5cb Changed NS_IMETHOD to NS_IMETHODIMP on implemented function.
git-svn-id: svn://10.0.0.236/trunk@52363 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 07:38:44 +00:00
beard%netscape.com
46857947de made more robust with partial output.
git-svn-id: svn://10.0.0.236/trunk@52362 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 06:05:09 +00:00
dp%netscape.com
76860bfac3 Removing use of nsIShutdownListener r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52361 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 05:02:55 +00:00
troy%netscape.com
3300906c1f b=15742. Changed Reflow() to invalidate the child's bounds if we're forced
to do a second reflow because we didn't correctly predict whether the vertical
scrollbar was needed. Because the second reflow changes the display width we
need to repaint


git-svn-id: svn://10.0.0.236/trunk@52360 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 04:04:32 +00:00
troy%netscape.com
c53de3fb2f b=17507. Changed Reflow() to use "available height" instead of "computed
height" when reflowing child frames. What was happening was that the child
table frame didn't fit and was trying to split. That should only happen when
we're paginated


git-svn-id: svn://10.0.0.236/trunk@52359 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:39:24 +00:00
troy%netscape.com
248afe72e1 b=17573. Changed mRowIndex to be signed integer (was unsigned integer) but
field. This allows it be negative, which some of the table code is depending
on


git-svn-id: svn://10.0.0.236/trunk@52358 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:15:52 +00:00
brendan%mozilla.org
9c83cbc655 Gross workaround for VC5 bug.
git-svn-id: svn://10.0.0.236/trunk@52357 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:04:02 +00:00
jband%netscape.com
9a6507c902 fix typo that was causing bustage on some compilers
git-svn-id: svn://10.0.0.236/trunk@52356 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:02:43 +00:00
dmose%mozilla.org
5c49b2dcfa removing qtfe files from the tip, since qtfe is only ever destined to build on the MozillaClassic branch; approved=arnt@troll.no
git-svn-id: svn://10.0.0.236/trunk@52355 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:29:26 +00:00
beard%netscape.com
fdd0b24390 changed the CID for "component://netscape/gfx/region" to use new NS_SCRIPTABLEREGION_CID. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52354 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:28:32 +00:00
beard%netscape.com
f871d649af switched to NS_IMPL_ISUPPORTS1, no longer supports QI to nsIRegion. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52353 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:10 +00:00
beard%netscape.com
8070950a1a removed scriptable region hackery, switched to NS_IMPLE_ISUPPORTS1. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52352 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:06 +00:00
beard%netscape.com
2f5831d91f cleaned up factory to use nsCOMPtrs, modern NS_IMPL* macros, support for creating scriptable regions. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52351 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:03 +00:00
beard%netscape.com
48e85583a8 added NS_SCRIPTABLE_REGION_CID. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52350 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:25:59 +00:00
tbogard%aol.net
74d906dbdf Fixed changes to use the GetPresShell rather than using the now removed member variable.
git-svn-id: svn://10.0.0.236/trunk@52348 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:05:21 +00:00
brendan%mozilla.org
f980be0221 (13163, r=alecf, scc, waterson, others; names available on request)
- Fix most of bug 13163 (see TODO for rest).  This entails adding a version-string argument to nsIScriptContext::EvaluateString and passing it around lots of places in content sinks. 

- Fix leaks and confusion about mSecurityManager and mNameSpaceManager in nsJSEnvironment.cpp.  These still need to move from nsJSContext to nsGlobalWindow or thereabouts, jband and vidur are looking at that. 

- Added comments and expanded tabs in nsJSEnvironment.cpp, esp. to EvaluateString.  Also changed various nsresult vars to be named rv.  Also restored brace/style conformity to nsJSProtocolHandler.cpp. 

- Factored CompileFunction from AddScriptEventListener to pave the way for brutal sharing of compiled JS event handlers via JS_CloneFunctionObject. 

- Lots of nsCOMPtr uses added.  I'm using one for mNameSpaceManager.  Hold mSecurityManager as a service explicitly, on the other hand (awaiting scc's fix to allow comptrs for services), and release in nsJSContext's dtor (fixing a leak).  These two managers should be moved to the window object -- TODO item below. 

- Hold JSRuntimeService along with JSRuntime for live of nsJSEnvironment, fix for shaver. 

- Fix window.setTimeout etc. so the filename and line number of the timeout expr is propagated.  This meant factoring nsJSUtils.cpp code. 

- Fix all content sinks to use the same, and up-to-date JavaScript version parsing (whether for script type or for old language attribute); also fix SplitMimeType clones to strip whitespace. 

- With waterson, fix bug in brutal-sharing version of XUL content sink: script src= should not evaluate the inline content of its tag.


git-svn-id: svn://10.0.0.236/trunk@52347 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:43:30 +00:00
scc%netscape.com
65b7cd0c03 changed the mechanism underlying |do_QueryInterface| to decouple |nsCOMPtr| from services, |nsIWeakReference|, etc. This change fixes bug #17364, and paves the way for making |nsCOMPtr| cooperate with services. r=valeski (additional builds done by dmose and syd)
git-svn-id: svn://10.0.0.236/trunk@52346 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:35:48 +00:00
scc%netscape.com
3872148e22 removed incorrect use of private class name in favor of |do_QueryInterface|, part of the fix for bug #17364, r=valeski (additional builds done by dmose, and syd)
git-svn-id: svn://10.0.0.236/trunk@52345 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:32:15 +00:00
syd%netscape.com
dc0e84da8f Add xpcom.dll to link line so test will link with scc changes make about this time. r=scc
git-svn-id: svn://10.0.0.236/trunk@52344 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:22:53 +00:00
pavlov%netscape.com
e4422a7744 better fix for twips rounding problems patch_from=dbaron@fas.harvard.edu r=me
git-svn-id: svn://10.0.0.236/trunk@52343 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:09:52 +00:00
sgehani%netscape.com
1a10f1bfca Turning on Mac Install Wizard. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@52342 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 23:04:41 +00:00
sgehani%netscape.com
42a5d3afe8 *** NOT PART OF BUILD ***
Added "About..." box.


git-svn-id: svn://10.0.0.236/trunk@52341 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:29:26 +00:00
sgehani%netscape.com
2eefd82de8 Changes to accomodate ASEncoder for bug 17096 (new interfaces: GUI and AppleScript to accept folders to decode and encode). [r=dveditz]
git-svn-id: svn://10.0.0.236/trunk@52340 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:24:09 +00:00
sgehani%netscape.com
c148d9293b First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52339 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:21:38 +00:00
sgehani%netscape.com
1d98e513a5 *** NOT PART OF BUILD ***
Fixes for bug 17096. New interfaces (GUI and AppleScript) that accept folders to encode and decode.


git-svn-id: svn://10.0.0.236/trunk@52338 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:21:28 +00:00
sgehani%netscape.com
9318031900 Fixing static targets to be usable by MIW once again: removed new nsJARInputStream from the static targets. For real this time...
git-svn-id: svn://10.0.0.236/trunk@52337 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:18:31 +00:00
sgehani%netscape.com
66089af9ca Backed out change temporarily.
git-svn-id: svn://10.0.0.236/trunk@52336 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:03:46 +00:00
sgehani%netscape.com
43165f999b Fixing static targets to be usable by MIW once again: removed new nsJARInputStream from the statis targets.
git-svn-id: svn://10.0.0.236/trunk@52335 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 21:56:51 +00:00
beard%netscape.com
95ab15987f MLK: fix device context leak, bug=15380, r=scc
git-svn-id: svn://10.0.0.236/trunk@52334 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 20:18:31 +00:00
beard%netscape.com
7eff69da6d MLK: fixed nsICSSDeclaration leak, bug=15380, r=kipp
git-svn-id: svn://10.0.0.236/trunk@52333 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 20:17:40 +00:00
dp%netscape.com
ab8b41ac6e Fixing viewer starup assert on SetMainThread() happening twice.
git-svn-id: svn://10.0.0.236/trunk@52332 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 17:17:12 +00:00
troy%netscape.com
bf93831e8b Removed call to SetMainThread() because it was triggering an assert. Turns
out NS_InitXPCOM() does it so we don't need to do it twice


git-svn-id: svn://10.0.0.236/trunk@52331 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:44:04 +00:00
buster%netscape.com
33e56d70f4 huge performance work for text controls
we now display the content of a single line text control using a child pseudo frame
until the text control first gets focus.  at that time, a webshell and editor are created on the fly.
fixed bug bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52330 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:33:00 +00:00
buster%netscape.com
12d91fc204 added pseudo style for single line text controls
bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52329 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:31:11 +00:00
buster%netscape.com
2da450442d added DOM notification up to frame system for text control value changes
part of  bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52328 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:30:33 +00:00
buster%netscape.com
2669825bf4 added pseudo-style for single line text controls. bug 14727
git-svn-id: svn://10.0.0.236/trunk@52327 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:29:32 +00:00
troy%netscape.com
23e130e01b Added nsHTMLReflowState.h
git-svn-id: svn://10.0.0.236/trunk@52326 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:16:45 +00:00
alecf%netscape.com
78d06b8fcf make buttons class="push"
only a test, not part of product


git-svn-id: svn://10.0.0.236/trunk@52325 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:39:07 +00:00
alecf%netscape.com
225dbf24eb update debug menu to reflect new DOMViewer location
(debug only not part of product)


git-svn-id: svn://10.0.0.236/trunk@52324 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:38:12 +00:00
alecf%netscape.com
20afa40ad0 fix a warning
r=pavlov


git-svn-id: svn://10.0.0.236/trunk@52323 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:32:23 +00:00
alecf%netscape.com
4eaeb0af68 move DOM viewer into chrome so that DOM security doesn't f us up again
only a test, not part of the product


git-svn-id: svn://10.0.0.236/trunk@52322 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:23:07 +00:00
alecf%netscape.com
4c4a69c07f more tweaks for boehm to catch up with the nsILeakDetector work
git-svn-id: svn://10.0.0.236/trunk@52321 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:06:26 +00:00
dp%netscape.com
0b96f92229 Removing shutdown listener. Releasing gCaseConv on XPCOM Shutdown r=kipp
git-svn-id: svn://10.0.0.236/trunk@52320 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 06:45:45 +00:00
beard%netscape.com
015fa0cad4 fixed up -blame option to use line marking.
git-svn-id: svn://10.0.0.236/trunk@52319 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:59:02 +00:00
alecf%netscape.com
1cd1d3967c more adding of class="dialog" to dialogs
git-svn-id: svn://10.0.0.236/trunk@52318 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:55:15 +00:00
beard%netscape.com
2300c27a4f fix nsIInterfaceInfoManager leak. bug=15380, r=jband
git-svn-id: svn://10.0.0.236/trunk@52317 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:48:07 +00:00
alecf%netscape.com
2dd3c4eacc add class="dialog" to mailnews prefs panes
this and last checkin r=rgoodger@ihug.co.nz


git-svn-id: svn://10.0.0.236/trunk@52316 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:46:04 +00:00
alecf%netscape.com
75c3ca9e17 add class="dialog" to all pref window dialogs
enable languages pane and fix XUL
disable smart_browsing pane (because it was crashing)


git-svn-id: svn://10.0.0.236/trunk@52315 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:44:23 +00:00
beard%netscape.com
ceb9cf186d changed gInstanceClassName from char[256] to const char* to save space. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52314 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 04:02:54 +00:00
beard%netscape.com
9a3ae339ee changed gInstanceClassName from char[256] to const char* to save space. added NS_IF_RELEASE(mFontMetrics) to destructor to fix memory leak. bug=15380, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52313 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 04:02:50 +00:00
danm%netscape.com
cd569b141a insert cast necessary on one of the "other" platforms
git-svn-id: svn://10.0.0.236/trunk@52312 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 03:13:55 +00:00
troy%netscape.com
6210745a33 Updated to not export nsIFrameReflow.h
git-svn-id: svn://10.0.0.236/trunk@52311 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:53:36 +00:00
troy%netscape.com
19db355c46 Changed to not export nsIFrameReflow.h
git-svn-id: svn://10.0.0.236/trunk@52310 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:52:43 +00:00
troy%netscape.com
88c4d96e2c Folded reflow functions into nsIFrame and eliminated nsIFrameReflow and
nsIHTMLReflow. This saves 4 bytes per frame and cleans things up


git-svn-id: svn://10.0.0.236/trunk@52309 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:52:11 +00:00
tbogard%aol.net
f5d99c2cec Removed mPresShell and mPresContext from the base class. Added internal getter function GetPresShell to retrieve presShell objects. Added a pointer to mContentViewer. Changed LoadURI* to take a presContext. Changed SetDocument to take a presContext. Changed the attribute presContext to be read only.
git-svn-id: svn://10.0.0.236/trunk@52308 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:30:13 +00:00
akhil.arora%sun.com
4e94fff191 r=akhil.arora@sun.com, fix by Denis Sharypov <sdv@sparc.spb.su>
13271: the wrong method was being called in ProcessingInstructionImpl.cpp
13338: handle null input arguments gracefully without crashing


git-svn-id: svn://10.0.0.236/trunk@52307 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:14:28 +00:00
beard%netscape.com
85fd5baad4 moved call to nsIThread::SetMainThread() to NS_InitXPCOM. r=warren
git-svn-id: svn://10.0.0.236/trunk@52306 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:53:03 +00:00
beard%netscape.com
7cf4142599 added call to nsIThread::SetMainThread(), to ensure users of XPCOM get a main thread mapped. r=warren
git-svn-id: svn://10.0.0.236/trunk@52305 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:52:55 +00:00
nisheeth%netscape.com
2d10931ddb Fix for bug 17540. Uncommented the call to nsFrameManager::CantRenderReplacedElement().
git-svn-id: svn://10.0.0.236/trunk@52303 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:31:49 +00:00
beard%netscape.com
15bc1a40b1 Removed statically constructed nsAutoString LinkCommand, moved inside nsWebShell::LoadURL(). This prevents calling printf before main runs on MacOS, which messes up the console window. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52302 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:23:01 +00:00
waterson%netscape.com
89a8c47740 '#if 0' DOM crawling code in toolbar frame to avoid over-eager generation of content model from RDF. GetElementsByTagName() is evil! r=pinkerton,hyatt
git-svn-id: svn://10.0.0.236/trunk@52301 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:21:44 +00:00
beard%netscape.com
20f6524e69 Fix proxied objects leak. r=sfraser, bug=15380
git-svn-id: svn://10.0.0.236/trunk@52300 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:17:24 +00:00
tbogard%aol.net
7b140eafb2 Removed zoom now that it has been moved out of the nsIGenericWindow interface.
git-svn-id: svn://10.0.0.236/trunk@52299 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:53:41 +00:00
tbogard%aol.net
069e0c0ab7 Moved zoom attribute from nsIGenericWindow to nsIDocShell. Updated zoom documentation.
git-svn-id: svn://10.0.0.236/trunk@52298 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:52:57 +00:00
hangas%netscape.com
bd127b8712 Fixed OK/Cancel button appearance by using globalOverlay.xul r=mscott
git-svn-id: svn://10.0.0.236/trunk@52297 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:14:52 +00:00
hangas%netscape.com
273c3a1673 Image transparency problem fixed by Andrew Niese.
git-svn-id: svn://10.0.0.236/trunk@52296 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:07:21 +00:00
tbogard%aol.net
945c6841ea Removed mDocument in favor of the preferred way of getting the document from the content viewer.
git-svn-id: svn://10.0.0.236/trunk@52295 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:02:38 +00:00
tbogard%aol.net
bc6a15f81a Changed a call to QueryInterface to use CallQueryInterface which helps with type checking.
git-svn-id: svn://10.0.0.236/trunk@52294 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:59:20 +00:00
valeski%netscape.com
0e08363c68 warning fixes, again :(
git-svn-id: svn://10.0.0.236/trunk@52293 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:35:06 +00:00
evaughan%netscape.com
1f41bc5a41 Fixed bug in example. -r hyatt
git-svn-id: svn://10.0.0.236/trunk@52292 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:27:26 +00:00
Jerry.Kirk%Nexwarecorp.com
95ed3035d3 Fixing FillPolygon code in nsRenderingPh.cpp
Adding debug code in nsDrawingSurfacePh  to find the crash.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52291 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:18:16 +00:00
Jerry.Kirk%Nexwarecorp.com
7d754fa3e8 Changing mClipSibling to False in preparation to popup change
Pavlov is working on/thinking about... I'm sure he will see it my
way eventually...
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52290 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:16:57 +00:00
mjudge%netscape.com
c750a7c32d reviewed by hyatt bug of someone elses but in my code. dont know number. simple check for null
git-svn-id: svn://10.0.0.236/trunk@52289 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:12:44 +00:00
mjudge%netscape.com
2dee462ae3 i cannot find the bug# it is for selecting inside forms. we need to turn off selection in certain frames based on the style. this sets up it to work once we figure out the style rule to set.
git-svn-id: svn://10.0.0.236/trunk@52288 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:07:07 +00:00
colin%theblakes.com
a3feb440b1 Only define MDCPUCFG if HOST_NSPR_MDCPUCFG is defined. r=cls
git-svn-id: svn://10.0.0.236/trunk@52287 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:03:15 +00:00
rogerl%netscape.com
b817d51d4b I changed the exepcted value for object.toString() calls on the empty
object - There's no clear documentation of the result, but the source
code unambiguously calls 'js_obj_toSource', which inserts the extra '()'
under the version1_2 flag, so I believe this is the correct result.


git-svn-id: svn://10.0.0.236/trunk@52286 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:02:17 +00:00
valeski%netscape.com
2eefe93ceb 17521, r = mscott. FTP authentication dialogs we're looping if canceled. I also changed a bunch of string getter routines to take XPIDLCStrings. there was speculation during the reveiw that there might be some casting problems on other platforms. if this is the case either case the XPIDLCString to (const char *) or call me and I'll do it.
git-svn-id: svn://10.0.0.236/trunk@52285 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:00:52 +00:00
edburns%acm.org
31ca3266f1 r=marklin
#17358
approver=edburns
author=edburns

This fix enables webclient to work with the latest mozilla.  For now.


git-svn-id: svn://10.0.0.236/trunk@52284 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:51:06 +00:00
rogerl%netscape.com
b16f4bc0c7 Changed to account for latest ECMA spec on back-references vs. octal
git-svn-id: svn://10.0.0.236/trunk@52283 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:50:43 +00:00
rogerl%netscape.com
fa193f41c1 New ECMA spec for no argument calls to max & min - should return +/- Inf
git-svn-id: svn://10.0.0.236/trunk@52282 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:48:33 +00:00
brendan%mozilla.org
ba803ea225 Add JS_VersionToString and JS_StringToVersion, updated Impl. Version (13163, r=shaver@mozilla.org).
git-svn-id: svn://10.0.0.236/trunk@52281 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:44:35 +00:00
akkana%netscape.com
d167106925 Remove one GDK_question. Trivial one-line fix
git-svn-id: svn://10.0.0.236/trunk@52280 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:37:18 +00:00
cmanske%netscape.com
1095535469 Fixed Composer UI to adjust to latest global CSS changes. Mostly needed to add appropriate class to titled buttons. Change editorshell to stop throbber animation even if editor fails to initialize. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52279 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:33:34 +00:00
jefft%netscape.com
01d415eebe fixed bug 12131 -- message counts not updated after a move/copy; call UpdateFolder() after move/copy is done; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@52278 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:28:55 +00:00
rogerl%netscape.com
8760c5b5e8 r=norris
Change for ECMA spec. - String.charCodeAt, etc call ToInteger on index.
Ditto - String.match(re) was constructing /undefined/ instead of empty
regexp.


git-svn-id: svn://10.0.0.236/trunk@52277 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:27:33 +00:00
rogerl%netscape.com
853e43bd31 r=norris
Opinion was that Script.exec() should execute in global scope, not caller.


git-svn-id: svn://10.0.0.236/trunk@52276 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:25:25 +00:00
rogerl%netscape.com
dcacacf7d7 r=norris
Fixed accidental eating of exceptions (match loop didn't terminate on
failure). New ECMA definition (again) of back reference format.


git-svn-id: svn://10.0.0.236/trunk@52275 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:23:36 +00:00
rogerl%netscape.com
e8f1c05ca6 r=norris
New ECMA behaviour for max & min.


git-svn-id: svn://10.0.0.236/trunk@52274 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:21:54 +00:00
rogerl%netscape.com
2ed88ba80b r=norris
Upgrading to new ECMA - conversionError subsumed by TypeError.


git-svn-id: svn://10.0.0.236/trunk@52273 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:20:23 +00:00
rogerl%netscape.com
69933e9f74 r=norris, Bug#16984
New error message for function.apply arguments.


git-svn-id: svn://10.0.0.236/trunk@52272 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:19:04 +00:00
rpotts%netscape.com
021f44ae53 Fixed crash during error condition in END_WRITE... (r=warren)
git-svn-id: svn://10.0.0.236/trunk@52271 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:14:52 +00:00
evaughan%netscape.com
0fa061c765 Made tabs us visibility instead of shrinking their children to 0,0.
Made it possible to change the look for the selected tab.


git-svn-id: svn://10.0.0.236/trunk@52270 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:13:57 +00:00
waterson%netscape.com
0d6ebd6b12 Pull script object and event listener list out of slots and into delegate to avoid faulting a heavyweight element. Fix EnsureSlots() to _not_ do a bunch of extra work that is already being done when we create an element from its prototype. Use nsCOMPtr's in nsXULAttributes to avoid leak of nsIStyleRule. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52269 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:09:20 +00:00
varada%netscape.com
b1f24224b8 fix for bug #14012 viewfile function to open the files and open url to open html
git-svn-id: svn://10.0.0.236/trunk@52268 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:57:00 +00:00
rchen%netscape.com
604931010d Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52267 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:53:20 +00:00
mscott%netscape.com
29d7ee003b first created.
git-svn-id: svn://10.0.0.236/trunk@52266 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:49:19 +00:00
mscott%netscape.com
6ad3ce8ee3 Moving URI dispatching code into its new home in mozilla\uriloader. I'll be removing
the existing files that I put in netwerk very soon.


git-svn-id: svn://10.0.0.236/trunk@52265 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:46:18 +00:00
rchen%netscape.com
6be0ffb4ca Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52264 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:40:07 +00:00
rchen%netscape.com
89f810c614 Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52263 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:37:43 +00:00
bienvenu%netscape.com
fa7e1e0f1e fix body filters, r=sspitzer 17058
git-svn-id: svn://10.0.0.236/trunk@52262 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:33:44 +00:00
rchen%netscape.com
beb892e3f0 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52261 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:27:41 +00:00
rogerl%netscape.com
338c55ea1d New, spawned from AIX4.2.mk.
git-svn-id: svn://10.0.0.236/trunk@52260 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:14:31 +00:00
rchen%netscape.com
394244ab39 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52259 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:12:26 +00:00
alecf%netscape.com
ea62024583 fix a broken class= r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52258 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:11:06 +00:00
alecf%netscape.com
ee5415192d add class="dialog push" to the profile wizard UI r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52257 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:10:53 +00:00
alecf%netscape.com
928787debd add class="dialog push" to all pref windows r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52256 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:01:41 +00:00
rchen%netscape.com
e6e52fc833 Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52255 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:58:42 +00:00
rchen%netscape.com
280221ed46 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52254 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:52:42 +00:00
alecf%netscape.com
52ddc97b98 fix titledbutton class to "dialog push"
r=shaver


git-svn-id: svn://10.0.0.236/trunk@52253 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:51:41 +00:00
valeski%netscape.com
7559ac64c5 15590 - build warnings prompted some variable name changes. Also replaced nsVoidArray usage w/ nsCStringArrays. Added some null checks. converted some raw ptrs to com ptrs.
16968 - bugzilla wasn't progress through bug lists via "next" "prev" links. we now set cookie headers from within x-multi-mixed-replace data.


git-svn-id: svn://10.0.0.236/trunk@52252 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:50:06 +00:00
karnaze%netscape.com
7868fc24c7 new regression test
git-svn-id: svn://10.0.0.236/trunk@52251 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:47:33 +00:00
valeski%netscape.com
85c426971e 15590, r=kipp. added a nsCStringArray class so the cool string array functionality could be used for CStrings too. this checkin is *part* of a fix to the bug
git-svn-id: svn://10.0.0.236/trunk@52250 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:47:17 +00:00
putterman%netscape.com
9c5e4137a1 Fix for 17556. Reviewed by alecf. Newsgroups show abbreviated name in folder pane.
git-svn-id: svn://10.0.0.236/trunk@52249 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:46:15 +00:00
cata%netscape.com
324e2f56a7 Fix for bug #17018, r=cata, checkin for momoi.
git-svn-id: svn://10.0.0.236/trunk@52248 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:41:21 +00:00
despotdaemon%netscape.com
e9ccfad854 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@52247 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:41:01 +00:00
cata%netscape.com
eb0df2c879 Fix for bug #16186 build warnings; eliminating unused var.
git-svn-id: svn://10.0.0.236/trunk@52246 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:32:00 +00:00
cata%netscape.com
b855e5dd72 Fix for bug #15706; r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52245 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:29:40 +00:00
rchen%netscape.com
bca34cf5da Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52244 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:28:18 +00:00
karnaze%netscape.com
b2c6378cf2 bug 17375 - better checks and casting before calling DidAppendRow
git-svn-id: svn://10.0.0.236/trunk@52243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:25:13 +00:00
rchen%netscape.com
a74e27b3f5 Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52242 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:24:48 +00:00
harishd%netscape.com
bb63ac5e3f Fix fof bug 15674 - Putting back char* buffer.
r=akkana


git-svn-id: svn://10.0.0.236/trunk@52241 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:59:09 +00:00
akkana%netscape.com
1645b0ed7a Only output the xif.xif debug file if DEBUG_XIF is defined. Requested by sfraser
git-svn-id: svn://10.0.0.236/trunk@52240 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:36:30 +00:00
akkana%netscape.com
e367bbd2be 17305: Add ? to the list of fakie-shifted keycodes. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52239 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:33:57 +00:00
morse%netscape.com
e3e9faf88f fix bug 14932, mozilla asserts if client-wallet is disabled, r=neeti
git-svn-id: svn://10.0.0.236/trunk@52238 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:31:30 +00:00
jefft%netscape.com
5b125a705f partial fix for bug 17034; decode encoded words prior setting to the composition fields; r=nhotta,rhp
git-svn-id: svn://10.0.0.236/trunk@52237 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:23:29 +00:00
slamm%netscape.com
3b0382f6c1 Use tb_find_build_record() instead of find_build_record().
git-svn-id: svn://10.0.0.236/trunk@52236 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:20:53 +00:00
slamm%netscape.com
3fd6cb1d50 Fix 17347. Initialize the 'View | Sidebar' menu to the correct state. r=mozbot.
git-svn-id: svn://10.0.0.236/trunk@52235 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:17:22 +00:00
slamm%netscape.com
45e93dc267 Get min heights correct so that the sidebar will collapse. r=evaughan.
git-svn-id: svn://10.0.0.236/trunk@52234 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:16:38 +00:00
slamm%netscape.com
8769efefd3 Add license.
git-svn-id: svn://10.0.0.236/trunk@52233 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:13:42 +00:00
vidur%netscape.com
a595e9b30a Fix for double frame creation for scripts that document.write content that causes sink context creation. Fix that allows the last children of a body to be flushed. R=harishd
git-svn-id: svn://10.0.0.236/trunk@52232 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:07:24 +00:00
slamm%netscape.com
0e1f052c66 Spit and polish. Take 2. Do not put 'undef' in 'my' list.
git-svn-id: svn://10.0.0.236/trunk@52231 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:01:14 +00:00
slamm%netscape.com
4c48633d37 Somethings not working. Backup
git-svn-id: svn://10.0.0.236/trunk@52230 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:54:32 +00:00
pnunn%netscape.com
66c14dd8b7 part of fix for bug#15817. r: akkana. strong suggestion by kipp. Do the right
thing in image container destructor.


git-svn-id: svn://10.0.0.236/trunk@52229 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:53:03 +00:00
slamm%netscape.com
731c45ad0c Clean up global names. Spit and polish. Fix '-w' warnings.
git-svn-id: svn://10.0.0.236/trunk@52228 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:52:04 +00:00
pnunn%netscape.com
f742f7e4fd fix for bug#17076. r: akkana. Puts data stream mime check before component
loading instead of after a component load failure.


git-svn-id: svn://10.0.0.236/trunk@52227 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:51:09 +00:00
ducarroz%netscape.com
e83ba4c213 Fix for bug 17493, We need to cleanup any GCI commands from the URI when generating a file name. R=rhp
git-svn-id: svn://10.0.0.236/trunk@52226 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:50:05 +00:00
warren%netscape.com
dfe868a09a Fixed round-off error computing bloat total.
git-svn-id: svn://10.0.0.236/trunk@52225 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:48:37 +00:00
varada%netscape.com
3e9b7b7fb2 fix for bug #17459 by adding another depend function onnext
git-svn-id: svn://10.0.0.236/trunk@52224 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:36:52 +00:00
varada%netscape.com
4f3ab7cb05 fix for bug #17459 as well as some clean up
git-svn-id: svn://10.0.0.236/trunk@52223 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:35:58 +00:00
sspitzer%netscape.com
db726a6afc fix for #17555. get all the default files, including panels.rdf
git-svn-id: svn://10.0.0.236/trunk@52222 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:29:07 +00:00
buster%netscape.com
3fe2b88255 more implementation
some nits to conform more to seamonkey coding conventions.


git-svn-id: svn://10.0.0.236/trunk@52221 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:25:57 +00:00
warren%netscape.com
7e5a7e1258 Fixed parsing of bloat log when value was nan, or class contained ::.
git-svn-id: svn://10.0.0.236/trunk@52220 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:05:09 +00:00
warren%netscape.com
a237edb9e7 Made the leak/bloat baseline only be the min over the last 5 entries.
git-svn-id: svn://10.0.0.236/trunk@52219 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 17:19:54 +00:00
kipp%netscape.com
363a93452d Fixed solaris build bustage
git-svn-id: svn://10.0.0.236/trunk@52218 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 15:20:20 +00:00
troy%netscape.com
de2a95b57c Space reduction. We now save 8 bytes per row frame by eliminating the max
top/bottom margin data members which are no longer needed


git-svn-id: svn://10.0.0.236/trunk@52217 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:40:58 +00:00
kipp%netscape.com
aaabce0894 r=troy; bugs 12958 and 12760; reworked the way that first-letter frames are created and updated. We now support incremental content changes even when first-letter style applies.
git-svn-id: svn://10.0.0.236/trunk@52216 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:39:48 +00:00
kipp%netscape.com
96da767847 r=troy; fixed a crash bug in the debug logic found while fixing 12958
git-svn-id: svn://10.0.0.236/trunk@52215 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:36:00 +00:00
kipp%netscape.com
5f8b23824a r=troy; api changes for 12958, 12760 and preperations for 17377
git-svn-id: svn://10.0.0.236/trunk@52214 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:35:36 +00:00
kipp%netscape.com
f35516791b r=troy; cleaned up resize reflow optimization logic and prepared it for fixing bug #17737 (not yet fixed!)
git-svn-id: svn://10.0.0.236/trunk@52213 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:34:53 +00:00
kipp%netscape.com
5a0f716ef3 r=troy; fixed letter frame logic to use the line layout to flow frames so that white-space trimming, for example, would work right
git-svn-id: svn://10.0.0.236/trunk@52212 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:34:01 +00:00
kipp%netscape.com
b3ecfed51c r=troy; updated api slightly to support fixes to bug 12760, 12958 and some resize-reflow optimization bugs
git-svn-id: svn://10.0.0.236/trunk@52211 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:33:26 +00:00
kipp%netscape.com
a2f8cba30c r=troy; use new line-layout api to help with some resize-reflow optimization bugs
git-svn-id: svn://10.0.0.236/trunk@52210 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:32:11 +00:00
rods%netscape.com
c01e8f06c0 Allows radiobuttons to remove themselves from the named radio group
when deleted factored the code
r=kmcclusk, bug 17418


git-svn-id: svn://10.0.0.236/trunk@52209 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:56:30 +00:00
rods%netscape.com
24bb2c855d removes itself from the radio group when it is destructed
r=kmcclusk, bug 17418


git-svn-id: svn://10.0.0.236/trunk@52208 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:54:58 +00:00
rods%netscape.com
38a193d9b4 clears the the checked item on removal
r=kmcclusk,bug 17418


git-svn-id: svn://10.0.0.236/trunk@52207 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:53:50 +00:00
kin%netscape.com
5fae6982e3 Fix for bug #16176: [DOGFOOD] need to annotate line frames with whitespace trim
layout/base/src/nsCaret.cpp
        - Modified DrawCaretWithContext so that we only
          adjust the caret position if we are within the
          frame's bounds.

    layout/html/base/src/nsTextFrame.cpp
        - Modified GetPointFromOffset() to add the width
          of a space if the offset is after a trailing space
          and it was trimmed off the frame.

r=sfraser@netscape.com


git-svn-id: svn://10.0.0.236/trunk@52206 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:43:11 +00:00
Jerry.Kirk%Nexwarecorp.com
e08673c042 Fixes for drawing the new Chrome. Had to explicitly call PgFlush
to flush the draw stream from the memory context into the off screen
buffer. I think this is a bug in Photon, but for now this is the fix.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52205 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 12:53:58 +00:00
pavlov%netscape.com
f24c85975a remove some tabs and add a check for null (bug 17252) r=syd
git-svn-id: svn://10.0.0.236/trunk@52204 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 09:03:53 +00:00
pavlov%netscape.com
385f05a7b1 fix for bugs 17234,17416 r=tor,bruce
git-svn-id: svn://10.0.0.236/trunk@52203 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 08:36:47 +00:00
pavlov%netscape.com
594fc96d9f fix for 15942 and some performance tests/code r=syd
git-svn-id: svn://10.0.0.236/trunk@52202 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 08:24:09 +00:00
danm%netscape.com
8dd72754a2 treat the return key, like enter, as if the default dialog button had been pressed. part of fix for bug 17529. r:saari@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52201 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:17:07 +00:00
danm%netscape.com
12fd34f1ce dialog now uses okCancelButtons overlay. partial fix for bug 17529 r:hangas@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52200 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:12:26 +00:00
cmanske%netscape.com
d779af105f Changed hover style for FormatToolbar for consistency with new UI
git-svn-id: svn://10.0.0.236/trunk@52199 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:04:48 +00:00
beard%netscape.com
73ee8b0ee5 added transitive closure size computation.
git-svn-id: svn://10.0.0.236/trunk@52198 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:04:01 +00:00
jband%netscape.com
d8b2fc8146 r=shaver@mozilla.org
- Fix for bug 13419 - xpconnect calls wrapped JS objects on wrong JSContext.
Added code to use the nsThreadJSContextStack in order to call wrapped
JS object on the JSContext that is current for the running thread.

We've made the rule that xpconnect only supports one JSRuntime. We
partially enforce that here by enforcing that the JSContext on which
we will run code hails from the same JSRuntime as the JSContext on
which the wrapper for the JS code was built.

Because it is perfectly legal for the nsThreadJSContextStack to be empty
if a wrapped JS object is being called from code other than a DOM event,
this system will lazily create a JSContext for the current thread and
maintain it in TLS. This JSContext is used as necessary. If it uses such
a JSContext that was not already on the nsThreadJSContextStack then the
system will temporarily push that JSContext onto the nsThreadJSContextStack
during the course of the function call being performed. This is all managed
my a new auto class: AutoPushCompatibleJSContext. This is used in the two
places where wrapped JS code is called from native code.

[the two places where this system is invoked are currently disabled due to
the fact that the DOM code makes bad assumptions about the JSContext on
which DOM objects can be accessed. We are working to fix that and then this
code will be enabled.]

- Add #ifdef XPC_DETECT_LEADING_UPPERCASE_ACCESS_ERRORS code that will help
users when we do things like fix bug 14460. As soon as we make more of the
idl declarations of methods leadingLowercase then we will have
LeadingUppercase calls from JS breaking at runtime. It is expected that this
will especially be a problem for coders working with the same interfaces
from both C++ and JS (since from C++ an interface has LeadingUpper methods and
the *same* interface seen from JS has leadingLowecase names). This code
(as suggested by shaver) will print out an informative error message when
it detects the misuse. This is currently enabled for DEBUG builds only.

- Copy code from xpcshell to TestXPC to use the JSRuntimeSerivce.

r=norris@netscape.com
- Check to see if a wrapped JS object has a QueryInterface property before
trying to call that method. This is a speed optimization. It also and makes
norris happy because his perrenial breakpoint in jsReportErrorNumber is not
getting hit (even though the old code was safe).


git-svn-id: svn://10.0.0.236/trunk@52197 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 05:42:41 +00:00
mcafee%netscape.com
b3a2df9860 Updating legend to match new output format.
git-svn-id: svn://10.0.0.236/trunk@52196 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 05:02:00 +00:00
troy%netscape.com
58248e0de3 Fix for bug #16649. Didn't actually change anything. Just restored some
code that was clobbered by revision 3.153


git-svn-id: svn://10.0.0.236/trunk@52195 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:57:02 +00:00
morse%netscape.com
4f5d2bc5d5 get ready for integration with http/ftp authentication, r=davidm
git-svn-id: svn://10.0.0.236/trunk@52194 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:51:27 +00:00
sspitzer%netscape.com
1bb663bbef fix for #8717. performance is good enough to bump this back to 500.
still more work to be done, as this is a per-server pref now, I think.


git-svn-id: svn://10.0.0.236/trunk@52193 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:49:41 +00:00
mcafee%netscape.com
dbd1674956 No spaces so units don't go on next line.
git-svn-id: svn://10.0.0.236/trunk@52192 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:45:52 +00:00
sspitzer%netscape.com
e36c5874dc fix it so that if you have something selected, and you hit enter, it starts with that profile.
git-svn-id: svn://10.0.0.236/trunk@52191 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:40:20 +00:00
bienvenu%netscape.com
9187011a29 changes to use nsIMsgWindow r=putterman
git-svn-id: svn://10.0.0.236/trunk@52190 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:39:06 +00:00
mcafee%netscape.com
d977243f6d oops left out b units
git-svn-id: svn://10.0.0.236/trunk@52189 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:36:17 +00:00
mcafee%netscape.com
d2807b6f90 Better units, r=brendan
git-svn-id: svn://10.0.0.236/trunk@52188 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:30:56 +00:00
morse%netscape.com
6bc4bb23b5 provide compatibility with single signon, r=davidm
git-svn-id: svn://10.0.0.236/trunk@52187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:30:38 +00:00
cmanske%netscape.com
55b30027eb Reduced size of Named Anchor proxy icon used in editor page to minimize layout disturbance when present. Changed colors.
git-svn-id: svn://10.0.0.236/trunk@52186 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:23:36 +00:00
sspitzer%netscape.com
3441bfea68 fix for #16231, r=mscott. make the file locator know about panels.rdf.
if <profile>/panels.rdf doesn't exist, copy the default to that location.


git-svn-id: svn://10.0.0.236/trunk@52185 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:02:25 +00:00
sspitzer%netscape.com
61aed8f307 fix for #16231, r=mscott. use the file locator (which caches the profile directory) instead of going through the profile service.
git-svn-id: svn://10.0.0.236/trunk@52184 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:02:20 +00:00
sspitzer%netscape.com
fc22d0aa61 remove the GetCurrentProfileDirFromJS() method from the nsIProfile interface. the only one using it was the sidebar js, but now that uses the fileLocator. r=mscott.
git-svn-id: svn://10.0.0.236/trunk@52183 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:01:22 +00:00
rginda%ndcico.com
0da4aac936 ** NOT PART OF THE SEAMONKEY DEFAULT BUILD **
* xul/tests/index.html
Content update.

* xul/tests/test3-output-loud.css
Added ugly style.

* Makefile.in, makefile.win
Updated to install new style.


git-svn-id: svn://10.0.0.236/trunk@52182 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:33:01 +00:00
warren%netscape.com
74b069723b Moved purify stuff into xpcom/base for the benefit of all.
git-svn-id: svn://10.0.0.236/trunk@52181 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:28:22 +00:00
warren%netscape.com
1fae170c08 Adding pure.h pure_api.c to the build. bug#16695
git-svn-id: svn://10.0.0.236/trunk@52180 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:26:50 +00:00
warren%netscape.com
3e59dc9845 Took out bogus error message.
git-svn-id: svn://10.0.0.236/trunk@52179 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:19:11 +00:00
waterson%netscape.com
4c9f59d49c Fix SizeOf() operation.
git-svn-id: svn://10.0.0.236/trunk@52178 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:07:38 +00:00
cmanske%netscape.com
941b2da9d7 Style adjustment for Composer DisplayMode toolbar
git-svn-id: svn://10.0.0.236/trunk@52177 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:58:37 +00:00
cmanske%netscape.com
f320760ce4 Color adjustment for Composer DisplayMode toolbar
git-svn-id: svn://10.0.0.236/trunk@52176 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:47:47 +00:00
warren%netscape.com
d4cac369ff Printed out TOTAL line for showbuilds.cgi
git-svn-id: svn://10.0.0.236/trunk@52175 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:39:10 +00:00
cathleen%netscape.com
7754b4e90e update unix packaging list for missing chrome and res files (editor, xpinstall... )
git-svn-id: svn://10.0.0.236/trunk@52174 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:37:27 +00:00
cmanske%netscape.com
aa538bb21b Added 'Throbber' to Composer - more UI adjustments for new skin. Tweaked new toolbar images. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52173 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:33:51 +00:00
kipp%netscape.com
877bf64923 Implement the LIBMALLOC_NOFREE flag; add in support for memory fill count which increases the malloc by N and fills it with a pattern to help detect overruns and random memory corruptions
git-svn-id: svn://10.0.0.236/trunk@52172 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:19:25 +00:00
kipp%netscape.com
71e57e9bc0 Disabled some of my own debugging noise
git-svn-id: svn://10.0.0.236/trunk@52171 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:17:55 +00:00
rhp%netscape.com
aa26800137 Fix for message display - Bug #17481 - r: jefft
git-svn-id: svn://10.0.0.236/trunk@52170 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:17:10 +00:00
ssu%netscape.com
a9a91fcc7c fixing bugs #16935 and #11581. r=dvedtiz.
The first fix reverses the way xpinstall aborts/cleans up itself.  The
correct way is to undo the commands it ran in backwards order.

The second fixes problem with a install.js script not having called
finalizeInstall() yet still installing files.


git-svn-id: svn://10.0.0.236/trunk@52169 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:15:56 +00:00
kipp%netscape.com
87ff88fc08 nuked another silly warning because I got tired of seeing it
git-svn-id: svn://10.0.0.236/trunk@52168 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:06:33 +00:00
kipp%netscape.com
f748008a0b I added logic to the viewers browser window to disable javascript initiated popups during web crawling; I also fixed the web crawler to only initiate a new load after a previous document ends not a subdocument (again!)
git-svn-id: svn://10.0.0.236/trunk@52167 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:06:09 +00:00
kipp%netscape.com
20e3748d92 I added logic to the viewers browser window to disable javascript initiated popups during web crawling
git-svn-id: svn://10.0.0.236/trunk@52166 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:05:16 +00:00
gagan%netscape.com
213f166414 Fixed bug 17393. We were firing an OnStopRequest for redirect's response completion. That messes up imagelib which starts to reset/abort streams. r=waterson
git-svn-id: svn://10.0.0.236/trunk@52165 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:55:58 +00:00
kipp%netscape.com
0f8e430077 r=troy; fixed code to properly remove reflowc ommands when cancelling
git-svn-id: svn://10.0.0.236/trunk@52164 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:53:56 +00:00
wtc%netscape.com
407de78336 Need to set the reuseaddr socket option before PR_Bind, now that
PR_Bind no longer sets that option automatically (see Bugzilla #17184).


git-svn-id: svn://10.0.0.236/trunk@52163 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:41:34 +00:00
wtc%netscape.com
4adfa873d2 Bugzilla bug #15858: fixed compiler warnings.
git-svn-id: svn://10.0.0.236/trunk@52162 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:33:54 +00:00
jj%netscape.com
0410c9f36b added [xpiengine] module and rename 'ChromeRegistry' to 'ChomeRegistry' to be consistent with this typo across the tree.
git-svn-id: svn://10.0.0.236/trunk@52161 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:25:51 +00:00
waterson%netscape.com
6d0e00cdd4 Bug 15146. Brutal content model sharing, Phase II. XUL content sink now constructs prototype documents; 'real' content model constructed from walking prototype. Landed XUL_SHARING_19991027_BRANCH (derived from XUL_SHARING_19991022_BRANCH). See branch comments for details. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@52160 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:21:15 +00:00
mcafee%netscape.com
19573259fb typo, r=slamm
git-svn-id: svn://10.0.0.236/trunk@52159 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:21:06 +00:00
waterson%netscape.com
5a02e1350c Bug 15146. Remove usage of nsIXUL[Child|Parent]Document, nsIXULDocumentInfo. Now obsolete with brutal sharing. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52158 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:19:20 +00:00
dougt%netscape.com
72ec0f3079 adding license.
git-svn-id: svn://10.0.0.236/trunk@52157 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:10:00 +00:00
kipp%netscape.com
e8cc21c4c3 New tests (not part of any build)
git-svn-id: svn://10.0.0.236/trunk@52156 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:59:41 +00:00
warren%netscape.com
e6e16569fb Added 1k fudge factor.
git-svn-id: svn://10.0.0.236/trunk@52155 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:40:04 +00:00
sspitzer%netscape.com
695d6778d8 don't specify the height and width, let it size to content. otherwise, the buttons on the bottom don't show up.
git-svn-id: svn://10.0.0.236/trunk@52154 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:26:43 +00:00
mccabe%netscape.com
5124ea8599 adding comments
git-svn-id: svn://10.0.0.236/trunk@52153 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:26:19 +00:00
sspitzer%netscape.com
e8194ccfb1 cleaning up comments
git-svn-id: svn://10.0.0.236/trunk@52152 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:09:27 +00:00
mcafee%netscape.com
af1c129e99 Reverted to mozilla.org url because of problems with loading resource:
git-svn-id: svn://10.0.0.236/trunk@52151 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:32:13 +00:00
nhotta%netscape.com
978eb5faf1 Adding entity property files to packages, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@52150 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:31:30 +00:00
putterman%netscape.com
2df3525f9d More work on 17376. reviewed by bienvenu. Store open folder and keep array of msgWindows.
git-svn-id: svn://10.0.0.236/trunk@52149 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:27:21 +00:00
harishd%netscape.com
3d1723b618 Fix for bugs
1312   - Mapped all  HTML 4.0x FPIs to NOQUIRKS mode.
2749   - Tweaked strict comment handling code. -> r=rickg
17148 - Making sure that BeginContext() is ended only by EndContext()
17113, 1262 - Made AddLeaf(), in DTD,  to be cautious in handling text tokens.

Using bit-wise search  for IsContainer() instead of looping. ( nsElementTable )

Fixed warnings.

r=pollmann


git-svn-id: svn://10.0.0.236/trunk@52148 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:25:59 +00:00
mcafee%netscape.com
a6b5e55d70 Fixed extra my's that break in some versions of perl
git-svn-id: svn://10.0.0.236/trunk@52147 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:24:39 +00:00
sspitzer%netscape.com
a19b0a701f only show profiles that haven't been migrated in the Profile Selection dialog.
git-svn-id: svn://10.0.0.236/trunk@52146 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:24:05 +00:00
sspitzer%netscape.com
139ca8b52d adding "Mozilla Select Profile" (aka -SelectProfile) for the mac.
git-svn-id: svn://10.0.0.236/trunk@52145 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:19:02 +00:00
mcafee%netscape.com
14b918a812 Adding bloat formatting, baseline mechanism. warren/mcafee
git-svn-id: svn://10.0.0.236/trunk@52144 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:18:50 +00:00
sspitzer%netscape.com
9b563bc4a7 adding -SelectProfile for the mac.
git-svn-id: svn://10.0.0.236/trunk@52143 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:17:44 +00:00
sspitzer%netscape.com
761883462c checking in ben goodger's (rgoodger@ihug.co.nz) profile selection UI.
r=sspitzer

I made changes so that:

1)  exit quits the app, and doesn't start up app with the last current profile
2)  fix a spelling error (personalisation -> personalization), this is en-US, not en-UK
3)  fix it so start actually starts the selected profile.
4)  -SelectProfile launches this new dialog
5)  if the user starts with no command line, and they have more than one profile, they get -SelectProfile, and not -installer.


git-svn-id: svn://10.0.0.236/trunk@52142 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:08:46 +00:00
mcafee%netscape.com
cb42bc5347 switching to static pages.
git-svn-id: svn://10.0.0.236/trunk@52141 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:02:49 +00:00
mcafee%netscape.com
5d276fc49d fixing log rename problem. code=warren
git-svn-id: svn://10.0.0.236/trunk@52140 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:02:10 +00:00
sspitzer%netscape.com
39084ddb75 add support for SelectProfile
git-svn-id: svn://10.0.0.236/trunk@52139 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:56:00 +00:00
ftang%netscape.com
725ca86a3c fix bustage.
git-svn-id: svn://10.0.0.236/trunk@52138 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:38:58 +00:00
warren%netscape.com
25f7059c43 Fixed the fact that all pdb files get called default.pdb (which made it hard to debug when there was more than one test file in a directory). r=cyeh
git-svn-id: svn://10.0.0.236/trunk@52137 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:36:22 +00:00
rbs%maths.uq.edu.au
cdfb86c649 Catching up with recent changes of the nsIFrame API
git-svn-id: svn://10.0.0.236/trunk@52136 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:30:28 +00:00
waterson%netscape.com
ed6d691c92 Remove unused references to nsIXULChildDocument and nsIXULParentDocument.
git-svn-id: svn://10.0.0.236/trunk@52135 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:18:21 +00:00
pepper%netscape.com
856f1ee86f Added a newline to the end of file so that AIX and HP compilers are happy.
r=mgleeson


git-svn-id: svn://10.0.0.236/trunk@52134 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:17:43 +00:00
rbs%maths.uq.edu.au
4ea4c2ba26 Adding Dave Fiddes' patch for a MOZ_MATHML CFLAGS
git-svn-id: svn://10.0.0.236/trunk@52133 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:17:13 +00:00
waterson%netscape.com
c13911024a Remove redundant registration of well-formed DTD. r=rickg
git-svn-id: svn://10.0.0.236/trunk@52132 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:15:18 +00:00
waterson%netscape.com
0509ac6c24 Put column headers back in to folder pane. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@52131 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:14:14 +00:00
mccabe%netscape.com
c568cf9bed Add an API entry point for building JS Date objects from millisecond values.
Patches courtesy Chris Houck.  r=mccabe.


git-svn-id: svn://10.0.0.236/trunk@52130 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:11:41 +00:00
rhp%netscape.com
b3f1a34e11 Fix for sending plain text as binary files - Bug #16393 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@52129 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:09:27 +00:00
norris%netscape.com
a825f1738a work on bug 7270.
r=mstoltz.
Implement netscape.security.PrivilegeManager callbacks.


git-svn-id: svn://10.0.0.236/trunk@52128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:09:03 +00:00
mscott%netscape.com
58da4d1cc2 part of url dispatching framework.
build nsURLDispatcher.cpp


git-svn-id: svn://10.0.0.236/trunk@52127 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:08:57 +00:00
ftang%netscape.com
949f26b1d9 remove nsIDOMTextRange.h nsIDOMTextRangeList.h. fix bug 12756. r=tague
git-svn-id: svn://10.0.0.236/trunk@52126 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:05:42 +00:00
wtc%netscape.com
2989da583b Bugzilla bug #17486: need parentheses around a & operator in an expression
git-svn-id: svn://10.0.0.236/trunk@52125 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:03:08 +00:00
srinivas%netscape.com
894660c683 Export version descriptor. Bugzilla 4742
git-svn-id: svn://10.0.0.236/trunk@52123 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:28:46 +00:00
bienvenu%netscape.com
7a179cfe09 fix mac build bustage
git-svn-id: svn://10.0.0.236/trunk@52122 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:20:40 +00:00
mcafee%netscape.com
4a058b42d1 Ignore tree directories.
git-svn-id: svn://10.0.0.236/trunk@52120 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:16:44 +00:00
dmose%mozilla.org
0d77d490d6 script to update license boilerplate in source files
git-svn-id: svn://10.0.0.236/trunk@52119 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:16:29 +00:00
rpotts%netscape.com
4626597396 cleanup - removed unnecessary code checking that mRequest != nsnull. Now the mRequest is allocated at channel construction and the channel is deleted if the request allocation fails...
git-svn-id: svn://10.0.0.236/trunk@52118 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:15:56 +00:00
ssu%netscape.com
cc23cb4fd5 added new resource string. This is related to bug #17391. r=dbragg.
Affects only windows platforms.


git-svn-id: svn://10.0.0.236/trunk@52117 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:13:28 +00:00
alecf%netscape.com
32ed46c795 fix casting problem on solaris
git-svn-id: svn://10.0.0.236/trunk@52116 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:13:06 +00:00
ssu%netscape.com
da07ac32b1 fixing bug #17391. r=dbragg.
Fixes problem with calculating available disk space under
Win95/win98.  Affects only windows platforms.


git-svn-id: svn://10.0.0.236/trunk@52115 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:12:24 +00:00
warren%netscape.com
052c27feff Fixed thing that chops off final digit.
git-svn-id: svn://10.0.0.236/trunk@52114 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:06:36 +00:00
racham%netscape.com
8f6655fb4a r=gayatrib. Fix for Bug 16414. If the profile dir is deleted it always gets rebuilt based on the path it gets from registry
git-svn-id: svn://10.0.0.236/trunk@52113 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:05:26 +00:00
dp%netscape.com
f2caaa1890 Converting to module. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52112 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:59:49 +00:00
dp%netscape.com
b3499577af Convering to nsIModule. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52111 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:57:29 +00:00
dp%netscape.com
da7c33e34c Remove delete on nsISupports. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52110 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:44:45 +00:00
nhotta%netscape.com
b6d38ed4f7 Check input for the null pointer and empty string, bug 17287, r=ducarroz,jefft.
git-svn-id: svn://10.0.0.236/trunk@52109 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:41:45 +00:00
nisheeth%netscape.com
ce3c186894 r=nisheeth. Fix for bug 17237 from Rick Gessner (rickg@netscape.com). Thanks, Rick.
git-svn-id: svn://10.0.0.236/trunk@52108 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:40:08 +00:00
mscott%netscape.com
33fe7bdd57 Build new uri dispatching interfaces on the Mac.
git-svn-id: svn://10.0.0.236/trunk@52107 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:38:16 +00:00
mscott%netscape.com
1e3a7c2073 export uri dispatching interfaces.
git-svn-id: svn://10.0.0.236/trunk@52106 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:37:58 +00:00
despotdaemon%netscape.com
a82717bab8 Pseudo-automatic update of changes made by yueheng.xu@intel.com.
git-svn-id: svn://10.0.0.236/trunk@52105 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:34:51 +00:00
rods%netscape.com
189a26e941 Listboxes now obey CSS specifed sizes
r=kmcclusk,related to bug 16317


git-svn-id: svn://10.0.0.236/trunk@52104 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:31:23 +00:00
radha%netscape.com
ca4f530508 Fix for form values not maintained while going forward. bug # 16377. r=law
git-svn-id: svn://10.0.0.236/trunk@52103 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:29:43 +00:00
akhil.arora%sun.com
1aa54f66ab updated list of things todo, removing stuff that has been done
git-svn-id: svn://10.0.0.236/trunk@52102 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:28:20 +00:00
akhil.arora%sun.com
d6ca20f368 r=akhil.arora@sun.com By Igor Nekrestyanov <nis@sparc.spb.su>
Minor changes to handle unicode strings properly


git-svn-id: svn://10.0.0.236/trunk@52101 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:26:27 +00:00
sspitzer%netscape.com
3a3c45b57c fix warnings. r=valeski
git-svn-id: svn://10.0.0.236/trunk@52100 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:25:43 +00:00
kmcclusk%netscape.com
89bd3d196e Removed stray semi-colon after NS_DECL_ISUPPORTS bug=17235 r=rods@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52099 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:24:19 +00:00
alecf%netscape.com
5ecb0c11b3 prepare to consolidate server URI creation - create a new property of incoming servers, the local store type, and construct the URL from there.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@52098 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:22:06 +00:00
alecf%netscape.com
2e274875d3 more cleanup work - now retrieve the server at URI creation time, so that GetServer() is really fast, and just forward calls to GetUsername and GetPassword() to the server. r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52097 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:19:57 +00:00
terry%mozilla.org
7d80bedb81 Back out last change -- specific to mozilla.org, not to general consumers of bugzilla.
git-svn-id: svn://10.0.0.236/trunk@52096 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:18:03 +00:00
bienvenu%netscape.com
f488902f5d work on body filters and search r=mscott
git-svn-id: svn://10.0.0.236/trunk@52095 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:13:22 +00:00
valeski%netscape.com
b853096819 16968, r=gagan. Changed the way HTTP header notification occurs. now the channel does the notification. Also added SetREsponseHeaders() to the nsIHTTPChannel iface which allows outside users to add response headers (such as nsMultiMIMEConv/bugzilla) and have the new headers perculate to observers. also fixed HTTP handler leak, r=dp on that one.
git-svn-id: svn://10.0.0.236/trunk@52094 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:12:59 +00:00
endico%mozilla.org
9b799b1100 Try to herd netscape communicator users away from bugzilla. "if your browser has a blue N logo go report the bug to netscape". This wording may be wrong later on but it works for now.
git-svn-id: svn://10.0.0.236/trunk@52093 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:12:52 +00:00
mcafee%netscape.com
296f21777f Updating legend for C, bloaty stats.
git-svn-id: svn://10.0.0.236/trunk@52092 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:47:47 +00:00
varada%netscape.com
b921af7d24 fix for bug #12715 import feature for nci files
git-svn-id: svn://10.0.0.236/trunk@52091 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:26:35 +00:00
varada%netscape.com
7a333b1d09 fix for change in copydir function
git-svn-id: svn://10.0.0.236/trunk@52090 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:25:56 +00:00
warren%netscape.com
16156488f8 Enhanced delta report. Breakdown by what's new, what's changed, etc.
git-svn-id: svn://10.0.0.236/trunk@52089 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 18:57:37 +00:00
despotdaemon%netscape.com
04b5eac48c Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@52088 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 17:59:13 +00:00
norris%netscape.com
0d74bb8fa4 Fix spelling of contributor's name.
git-svn-id: svn://10.0.0.236/trunk@52087 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 17:43:43 +00:00
troy%netscape.com
aa66ccecfa Elimninated compiler warning
git-svn-id: svn://10.0.0.236/trunk@52086 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:41 +00:00
ftang%netscape.com
bd4b9fbaf5 fix two comment after brade review and point out my error in prev checkin. r=brade
git-svn-id: svn://10.0.0.236/trunk@52085 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:37 +00:00
troy%netscape.com
3cb8f38164 Eliminated compiler warning
git-svn-id: svn://10.0.0.236/trunk@52084 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:06 +00:00
troy%netscape.com
5149a61f62 Added more diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52083 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:38:14 +00:00
kipp%netscape.com
1786d79429 bug=17320; Fixed a purify warning
git-svn-id: svn://10.0.0.236/trunk@52082 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:33:34 +00:00
ftang%netscape.com
85c96d612c move all end of line # comment to the previous line. Remove all end of line tab and whitespace. Need this to fix Trad Chinese IME. Somehow our property file reader do not treat # as start of comment in a key value pair line. r=brade
git-svn-id: svn://10.0.0.236/trunk@52081 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:28:22 +00:00
vidur%netscape.com
1173466bfc Added a version of window.close, which when alled from script that defers actual closure if it is invoked from the script context of the window itself. Fixes bug 15261. R=joki.
git-svn-id: svn://10.0.0.236/trunk@52080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:12:56 +00:00
ftang%netscape.com
c3b0a312fc remove unnecessary #ifdef USE_XIM. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52079 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 13:16:07 +00:00
Jerry.Kirk%Nexwarecorp.com
4385e8d68e Call PtAppAddFd instead of PtAppAddFdPri because of redraw bugs it
was causing.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52078 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 12:43:46 +00:00
dp%netscape.com
f06f488185 Removing use of mRefCnt directly. Also, removed all use of refcounted
variable as creations were always refcounted. r=kipp


git-svn-id: svn://10.0.0.236/trunk@52077 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 11:42:15 +00:00
srinivas%netscape.com
a6569800ce Include system files for BeOS; checkin for <duncan@be.com>.
git-svn-id: svn://10.0.0.236/trunk@52076 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 11:40:33 +00:00
rickg%netscape.com
7d94513269 fixed bug17387 (pre-constructing DTD's). r=warren
git-svn-id: svn://10.0.0.236/trunk@52075 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 09:26:19 +00:00
cmanske%netscape.com
450e220228 More changes to Composer for new skin (mostly new images).
git-svn-id: svn://10.0.0.236/trunk@52073 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:42:30 +00:00
warren%netscape.com
afff9da3ba Fixed bug in calculating leak total.
git-svn-id: svn://10.0.0.236/trunk@52072 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:35:53 +00:00
warren%netscape.com
4677dd631f Changed file transport to facilitate jar: protocol -- parameterized by nsIFileSystem. Bug#12579 r=gagan,gayatrib
git-svn-id: svn://10.0.0.236/trunk@52070 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:02:07 +00:00
rickg%netscape.com
b14a509c76 fixed bug17388, dtd leak; r=mscott
git-svn-id: svn://10.0.0.236/trunk@52069 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:53:21 +00:00
tbogard%aol.net
cd2764bb20 Changes made to reflect changes in nsIGenericWindow and nsIScrollable.
git-svn-id: svn://10.0.0.236/trunk@52068 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:52:08 +00:00
tbogard%aol.net
8e4af380cc Removed RemoveFocus() from nsIGenericWindow. Moved SizeToContent() to nsIHTMLDocShell. Added setCurScrollPosEx and setScrollRangeEx to nsIScrollable. Moved a bunch of code from nsHTMLDocShell into the base class. Commented out some stuff. Everything should compile now.
git-svn-id: svn://10.0.0.236/trunk@52067 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:51:10 +00:00
mscott%netscape.com
3587a59aa7 build mime before compose so we can make sure nsIMimeStreamConverter.idl has been exported
before compose IDL files try to use it.


git-svn-id: svn://10.0.0.236/trunk@52066 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:23:20 +00:00
dougt%netscape.com
32412a1f03 Fix for this mornings crasher (17352) r=pavlov, mscott
git-svn-id: svn://10.0.0.236/trunk@52065 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 06:44:36 +00:00
ducarroz%netscape.com
a282d4acf9 another Mac bustage fix. Caught before it appears
git-svn-id: svn://10.0.0.236/trunk@52064 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 06:01:43 +00:00
ducarroz%netscape.com
d4df792c85 Fix Mac bustage for mscott.
Add build instruction for mozilla:mailnews:mime:public:MANIFEST_IDL.


git-svn-id: svn://10.0.0.236/trunk@52063 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:45:22 +00:00
mscott%netscape.com
1bac65d756 Remove incorrect export of nsIMimeStreamConverter.idl
git-svn-id: svn://10.0.0.236/trunk@52062 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:42:15 +00:00
mscott%netscape.com
1b39aa1dd7 more work to try to fix the mac build.
git-svn-id: svn://10.0.0.236/trunk@52061 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:39:14 +00:00
ducarroz%netscape.com
eaa801e49e Fix for bug 17405. We need to skip entry that aren't valid during the search. R=mscott (he has also approved the fact I checking despite a red tree)
git-svn-id: svn://10.0.0.236/trunk@52060 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:34:07 +00:00
mscott%netscape.com
dbf6bce997 Fix windows build breakage. Try to build mime before compose so the IDL files
get exported first.


git-svn-id: svn://10.0.0.236/trunk@52058 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:08:36 +00:00
mscott%netscape.com
5c68fcaafc fix mac build by exporting nsIMimeStreamConverter.idl
git-svn-id: svn://10.0.0.236/trunk@52057 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:56:12 +00:00
waterson%netscape.com
31deb6a74d Unix filenames are case-sensitive.
git-svn-id: svn://10.0.0.236/trunk@52056 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:36:04 +00:00
mscott%netscape.com
888899af25 Bug #16927 --> when quoting a message, don't try to force a message URI into a protcol url. Convert the rdf uri
into a url and use that instead. For quoting the msg, use NS_NewChannel and AsyncOpen. some cleanup to fix
some ref counting stuff including supporting a new interface. Using the component manager
to create the quote listener instead of using new.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52055 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:22:08 +00:00
mscott%netscape.com
1bc43aaac4 Use nsCOMPtr. Add nsIMsgQuoteListener support, remove some extra member variables that we didn't need.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52054 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:21:30 +00:00
mscott%netscape.com
5daada9f2c Bug #16927 add nsIMsgQuoteListener interface
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52053 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:21:02 +00:00
mscott%netscape.com
08f1d9c5a8 Bug #16927 --> add msg quote listener to module.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52052 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:20:41 +00:00
mscott%netscape.com
3b5d377a59 Bug #16927 --> add class id for msg quote listener
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52051 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:19:59 +00:00
karnaze%netscape.com
15d92465ad simplified caching of column frames. split out collapsing border processing into nsBorderCollapser (checked in previously). r=troy
git-svn-id: svn://10.0.0.236/trunk@52050 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:09:39 +00:00
karnaze%netscape.com
0ddb8bf0bc added files: mozilla/layout/html/table/src/nsTableBorderCollapser.cpp
git-svn-id: svn://10.0.0.236/trunk@52049 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:06:36 +00:00
karnaze%netscape.com
b363aea0eb new class for collapsing borders, extracted from nsTableFrame, r=troy
git-svn-id: svn://10.0.0.236/trunk@52045 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 03:51:55 +00:00
braddr%puremagic.com
d8fb5871d7 Move all nsIEnumerator usage over to NS_ENUMERATOR_FALSE from NS_COMFALSE in anticipation of nixing NS_COMFALSE in the near future.
r=scc


git-svn-id: svn://10.0.0.236/trunk@52044 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 03:16:48 +00:00
brendan%mozilla.org
da68e2dcd8 Fix bogus assertion (r=shaver@mozilla.org) found by chouck@geocast.com.
git-svn-id: svn://10.0.0.236/trunk@52043 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:50:15 +00:00
fur%netscape.com
50f46042f0 Removed unused variable declaration to eliminate warning
git-svn-id: svn://10.0.0.236/trunk@52042 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:48:32 +00:00
srinivas%netscape.com
bc406e3e1e Add PR_Block/Unblock_Interrupt functions. Bugzilla 17055
git-svn-id: svn://10.0.0.236/trunk@52041 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:48:01 +00:00
fur%netscape.com
dbcd581b59 Eliminated references to long-dead jsaddr.[ch].
Note: These files only used in standalone JS, not SeaMonkey build.


git-svn-id: svn://10.0.0.236/trunk@52040 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:45:01 +00:00
fur%netscape.com
e969fa7f4f Removed unused files - they have been dead for years
git-svn-id: svn://10.0.0.236/trunk@52039 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:42:49 +00:00
tbogard%aol.net
d9cd4dc3b8 Pushed many of the method implementations done by buster from nsHTMLDocShell into the base class.
git-svn-id: svn://10.0.0.236/trunk@52038 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:20:44 +00:00
mscott%netscape.com
5bfc03c26e part of url dispatching.
export the uri dispatching interfaces.
no reviewer for this makefile change.


git-svn-id: svn://10.0.0.236/trunk@52037 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:05:12 +00:00
danm%netscape.com
d5cb9410ae moving initial content focus from OnEndDocumentLoad to Show. Reinstating SetSizeFromXUL. reduces new window flashing and allows gtk windows to size from JS. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:52:49 +00:00
mscott%netscape.com
df0cb24c86 Checking this in for hangas. Fixes the grey menus in the compose window.
r=mscott


git-svn-id: svn://10.0.0.236/trunk@52035 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:52:13 +00:00
cmanske%netscape.com
c0c0bb47c7 Fixed bugs 16690, 16991. Also made UI changes to adjust for new 'skin' r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52034 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:51:07 +00:00
nisheeth%netscape.com
151090fbb2 r=nisheeth. Fix for bug 9781 submitted by Johnny Stenbeck (jst@citec.fi). Thanks Johnny.
git-svn-id: svn://10.0.0.236/trunk@52033 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:50:37 +00:00
hangas%netscape.com
9c4609c831 Fixed throbber id, bug 17271. r=german
git-svn-id: svn://10.0.0.236/trunk@52032 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:44:29 +00:00
law%netscape.com
85c96d1199 Bug #14999; remove last vestiges of app core usage; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52031 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:41:16 +00:00
law%netscape.com
41c8a495f1 Bug #14999, removing last vestiges of app core usage; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52030 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:39:33 +00:00
nisheeth%netscape.com
f341433a7c r=dp. Fix for bug 17411. Commenting out the call to nsFrameManager::CantRenderReplacedElement for now. This should let us open up the tree while dp and pnunn figure out the right fix.
git-svn-id: svn://10.0.0.236/trunk@52029 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:20:34 +00:00
tbogard%aol.net
f996be0ecd Changed nativeWindow* parentNativeWindow back to nativeWindow parentNativeWindow.
git-svn-id: svn://10.0.0.236/trunk@52028 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 00:45:13 +00:00
despotdaemon%netscape.com
20ec29f713 Pseudo-automatic update of changes made by andreww@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@52027 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 00:11:01 +00:00
hoa.nguyen%intel.com
a56d99d249 Initialize cookie manager. Allows cgi scripts to set and retrieve cookies through viewer. r=edburns@acm.org
git-svn-id: svn://10.0.0.236/trunk@52026 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:58:49 +00:00
buster%netscape.com
1f5101db18 added a bunch of initial implementation. does not compile yet, but that's ok because docshell isn't part of the build yet.
git-svn-id: svn://10.0.0.236/trunk@52025 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:50:19 +00:00
jfrancis%netscape.com
f4bfa77ae5 fix for 17056: making a list in empty doc didnt work; also making a new list item didn't work. r=floppy moose
git-svn-id: svn://10.0.0.236/trunk@52024 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:44:33 +00:00
sfraser%netscape.com
3b974396c6 Add the various menu-related arrow gifs. fixes bug 17368. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@52023 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:40:51 +00:00
jj%netscape.com
adfe3c048e First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52022 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:39:46 +00:00
putterman%netscape.com
7e1db2ef27 This should stop build bustage for clobber builds.
git-svn-id: svn://10.0.0.236/trunk@52021 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:39:15 +00:00
locka%iol.ie
74ff2dc2f4 Fixed some bugs in the copy to clipboard operation.
Control now calls NS_ShutdownXPCOM during destruction


git-svn-id: svn://10.0.0.236/trunk@52020 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:19:27 +00:00
locka%iol.ie
7eff36db02 Added a menu to the dialog.
Implemented tests for cut, copy, paste, select all


git-svn-id: svn://10.0.0.236/trunk@52019 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:17:51 +00:00
cata%netscape.com
1bb10c65f4 I'm checking in for momoi, r=cata, bug #17018, Charset Menu usability workaround.
git-svn-id: svn://10.0.0.236/trunk@52018 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:10:51 +00:00
ftang%netscape.com
657f0d5580 fix the delete last IME text problem. bug13494 . There are another fix in nsHTMLEditRules.cpp related this but I forget to put the bug # there. r=tague
git-svn-id: svn://10.0.0.236/trunk@52017 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:05:24 +00:00
troy%netscape.com
c96591767e b=6674, r=karnaze@netscape.com
Changed Paint() to set the clip rect only when the collapse offset isn't
(0, 0)


git-svn-id: svn://10.0.0.236/trunk@52016 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:21 +00:00
kipp%netscape.com
3a2fe236a8 r=troy; fixed bug #17346 - the nsTextFormatter self test code found a bug in the nsTextFragment ctor code...
git-svn-id: svn://10.0.0.236/trunk@52015 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:16 +00:00
hangas%netscape.com
5fb3a93517 Cleaned up bad style rules in global.css - should result in noticable performance improvement. Converted <titledbutton> rules to all use a class, this way we can be specific about how each type of button should look. Added line between columns in tree headers. Indented treecell contents. Cleaned up mail and AB toolbars. Fixed reflow and other drawing issues with toolbar buttons on new skins. Fixed problems in results tree on AB window. Other misc visual changes. Fixed bug 16530, changing the word Messenger to Mail. r=german/hyatt
git-svn-id: svn://10.0.0.236/trunk@52014 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:09 +00:00
cathleen%netscape.com
c249ccc29e adding missing editor chrome file to mac packaging list
git-svn-id: svn://10.0.0.236/trunk@52013 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:59:04 +00:00
ftang%netscape.com
c31d69ed3f add debugging code. fix remove last uncomited IMEText. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@52012 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:56:36 +00:00
akkana%netscape.com
018a1629cf 17305: Fix ? handling. Also add myself to a debug ifdef. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52011 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:53:52 +00:00
tague%netscape.com
282a0d9dcf Fixed bug #16463 - can't create profile with Danish version of Mozilla. I modified the locale mapping code to correct a bug where DA was getting mapped to LANG_DUTCH. r=nhotta@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52010 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:52:56 +00:00
bienvenu%netscape.com
d6e604a886 turn on date filters, r=mscott 10416
git-svn-id: svn://10.0.0.236/trunk@52009 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:45:18 +00:00
nisheeth%netscape.com
fa55e685cc r=pollmann, troy. Fix for bug 10564. Added some error checking code to prevent crashes reported on low memory configurations.
git-svn-id: svn://10.0.0.236/trunk@52008 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:45:05 +00:00
sdagley%netscape.com
41a1603c9d __MD_GetEnv now calls standard C's getenv if environment variable not in NSPR's table. r=beard
git-svn-id: svn://10.0.0.236/trunk@52007 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:44:48 +00:00
sspitzer%netscape.com
637de3c1b6 fix for #17285 and #17397. r=mscott.
properly migrate pop and nntp servers from 4.x that were not on the default ports (110 and 119, respectively).
also, set the default port pref to be -1, so that if we don't set the port, it gets set to -1.


git-svn-id: svn://10.0.0.236/trunk@52006 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:44:34 +00:00
morse%netscape.com
af16ae652b bug 17339, document.cookie throwing exception, r=neeti
git-svn-id: svn://10.0.0.236/trunk@52005 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:43:49 +00:00
rginda%ndcico.com
dece5d007f **NOT PART OF THE SEAMONKEY DEFAULT BUILD**
* xul/tests/test3-output-loud.css
Added css for "loud" style.

* xul/tests/blue_rock.gif
Added pic for new default style, from Eterm background collection.

* makefile.win, Makefile.in
Add blue_rock.gif to install files.

* js/lib/irc.js
Strip \r characters from input.

* xul/tests/index.html
Updated content.

* xul/tests/test3-handlers.js
Create userlist object onJoin if it isnt already there.

* xul/tests/test3-output-default.css
New default style.

* xul/tests/test3-static.js
Added irc.freei.net server to top of EFNet network.  This server does not
require the ident service, which is blocked by the NS firewall.

* xul/tests/test3.xul
Added "loud" style to menu (old default style.)


git-svn-id: svn://10.0.0.236/trunk@52004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:42:47 +00:00
morse%netscape.com
cfdf03bc1a bug 17120, can't startup if cookie dll missing, r=valeski
git-svn-id: svn://10.0.0.236/trunk@52003 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:41:36 +00:00
putterman%netscape.com
32be2053bd Added nsIMsgWindow.idl and nsIMsgRDFDataSource.idl
git-svn-id: svn://10.0.0.236/trunk@52002 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:40:34 +00:00
putterman%netscape.com
dd42c6ee85 Added nsMsgWindow.cpp
git-svn-id: svn://10.0.0.236/trunk@52001 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:39:37 +00:00
morse%netscape.com
0eb9ff94e0 part of bug 8227, dereferencing problems, r=rickg
git-svn-id: svn://10.0.0.236/trunk@52000 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:38:48 +00:00
putterman%netscape.com
ff9a018c1e Started work on 17376. reviewed by bienvenu. create an object that knows about
mailnews window data and pass it through backend.


git-svn-id: svn://10.0.0.236/trunk@51999 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:38:47 +00:00
cathleen%netscape.com
59a2f543c7 adding missing editor chrome files
git-svn-id: svn://10.0.0.236/trunk@51998 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:35:37 +00:00
matt%netscape.com
e180142807 fix for bug 15169 r-morse
git-svn-id: svn://10.0.0.236/trunk@51997 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:33:35 +00:00
matt%netscape.com
5077a5368d 17218 r-mcafee
git-svn-id: svn://10.0.0.236/trunk@51996 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:31:58 +00:00
rogerl%netscape.com
2bfa05205d Changed commandline option for classpath to 'classpath' instead of 'cp'
git-svn-id: svn://10.0.0.236/trunk@51995 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:22:56 +00:00
bienvenu%netscape.com
f3513af6e6 fix a couple ref-counting problems on news dbs, reviewed last week by sspitzer
git-svn-id: svn://10.0.0.236/trunk@51994 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:19:42 +00:00
bienvenu%netscape.com
6b1312845e fix off by one error computing display name from naked email address
git-svn-id: svn://10.0.0.236/trunk@51993 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:18:12 +00:00
rogerl%netscape.com
f891c9ebb9 Error message for apply argument type
git-svn-id: svn://10.0.0.236/trunk@51992 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:17:44 +00:00
rogerl%netscape.com
f3ae1fcf7a ECMA handling of undefined args for call & apply.
git-svn-id: svn://10.0.0.236/trunk@51991 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:17:05 +00:00
rogerl%netscape.com
7a5d5c9ad9 Handle LINE & SOURCEFILE in dumpIcode
Fix bug in multiple try/catch clauses after a catch - the tryStackTop was
being decremented twice.


git-svn-id: svn://10.0.0.236/trunk@51990 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:16:15 +00:00
rogerl%netscape.com
a8627f0cf6 Handle missing arg in match_or_replace
git-svn-id: svn://10.0.0.236/trunk@51989 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:14:46 +00:00
bienvenu%netscape.com
6b7fd317c4 turn on history ab collection for msg sending r=jefft, bug 14447
git-svn-id: svn://10.0.0.236/trunk@51988 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:14:37 +00:00
rhp%netscape.com
e735146e7c Fix for Unicode quoting to plain text compose - Bug: 15465 r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51987 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:11:51 +00:00
rogerl%netscape.com
89da4b6f9b ECMA specified handling of NaN inputs for max & min
git-svn-id: svn://10.0.0.236/trunk@51986 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:11:43 +00:00
rogerl%netscape.com
800a7e2800 Subsumed ConversionError into TypeError
git-svn-id: svn://10.0.0.236/trunk@51985 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:10:36 +00:00
mscott%netscape.com
e2730e12e8 Bug #17352 --> temporarily hide this crasher by inserting an extra
ref count of the event queue. this is horrible since we are introducing
a leak. we need to examine the ownership model of event queues for the app
shell. I'm going to get pavlov to help me look at fixing this bug for real.
r=dougt
a=gramps,granrose


git-svn-id: svn://10.0.0.236/trunk@51984 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:00:54 +00:00
dmose%mozilla.org
1710bfc387 updating license boilerplate in all files; checkin approved by leif@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51980 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 21:02:40 +00:00
braddr%puremagic.com
1dde1a4f56 Ooops.. tree closed, better back these out for now. Sorry.
git-svn-id: svn://10.0.0.236/trunk@51979 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 21:01:37 +00:00
larryh%netscape.com
dfb30043a3 BugZilla 17374. Add PROffset types
git-svn-id: svn://10.0.0.236/trunk@51978 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 20:29:22 +00:00
braddr%puremagic.com
7767d9393b Move all nsIEnumerator usage over to NS_ENUMERATOR_FALSE from NS_COMFALSE
in anticipation of nixing NS_COMFALSE in the near future.
r=scc (please contact him should there be any build issues)


git-svn-id: svn://10.0.0.236/trunk@51977 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 20:24:21 +00:00
bienvenu%netscape.com
642710bf52 fix race condition opening imap folder r=mscott, build stopper
git-svn-id: svn://10.0.0.236/trunk@51976 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 19:15:20 +00:00
kipp%netscape.com
0637f2c48a Backed out chris's accidental checkin (don't ask)
git-svn-id: svn://10.0.0.236/trunk@51973 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 15:57:35 +00:00
karnaze%netscape.com
03e8200f99 hello
git-svn-id: svn://10.0.0.236/trunk@51972 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 15:55:31 +00:00
vidur%netscape.com
48577bac14 Update mNumFlushed counts when we do a synchronous notification (in scripts, for example). This is so that a call to FlushTags while we're executing a script sees the context stack in an updated state. Fixes bug 14042. R=joki.
git-svn-id: svn://10.0.0.236/trunk@51971 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 14:03:15 +00:00
Jerry.Kirk%Nexwarecorp.com
a4c99c7c93 Finished implementing ListenToEventQueue.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51970 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 11:36:21 +00:00
idk%eng.sun.com
3b03dc263a bugId 17329
Added PlugletSecurityContext class.
Set ProxyJNI security context to PlugletSecurityContext
(see 15902)


git-svn-id: svn://10.0.0.236/trunk@51969 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:33:06 +00:00
hyatt%netscape.com
a036d65c5c working on theme switching r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51966 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:24:23 +00:00
idk%eng.sun.com
ab0a4a932c bugId 17316
Added 4 demo pluglets
a = laa@sparc.spb.su
r = idk@eng.sun.com


git-svn-id: svn://10.0.0.236/trunk@51965 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:10:36 +00:00
nisheeth%netscape.com
cd137af4d4 Fix for bug 15633. Fixing build warning with the patch submitted by James Clark (jjc@jclark.com). r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@51964 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:39:57 +00:00
briano%netscape.com
3387e5dd13 Automated update
git-svn-id: svn://10.0.0.236/trunk@51962 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:15:10 +00:00
nisheeth%netscape.com
74d8a9e437 Added --enable-detec-webshell-leaks autoconf flag.
git-svn-id: svn://10.0.0.236/trunk@51961 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:14:42 +00:00
nisheeth%netscape.com
0ca61f6f5c Added --enable-detect-webshell-leaks autoconf flag.
git-svn-id: svn://10.0.0.236/trunk@51960 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:13:48 +00:00
mcafee%netscape.com
dc2ef44aa6 switching to absolute leak/bloat numbers.
git-svn-id: svn://10.0.0.236/trunk@51959 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:02:25 +00:00
rpotts%netscape.com
d54c2a54d9 bug #13054. r=mscott,warren. Reworked how data is written to the network. I consolidated the writing of nsIBufferInputStreams and nsIInputStreams and limited the amount of data being wrtten at once to MAX_IO_TRANSFER_SIZE...
git-svn-id: svn://10.0.0.236/trunk@51957 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:51:12 +00:00
mscott%netscape.com
26a5e7abea Bug #14928 --> url dispatching. Adding initial scaffolding for the uri dispatcher service.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@51956 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:49:42 +00:00
rpotts%netscape.com
207123458e bug #16897. Consolidated the firing of OnStopRequest into the nsHTTPChannel. This is also called if a transport fails to be created...
git-svn-id: svn://10.0.0.236/trunk@51955 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:53 +00:00
sfraser%netscape.com
e025da23ff Ooops, maybe we do need one of those paths after all. r=floppy
git-svn-id: svn://10.0.0.236/trunk@51954 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:35 +00:00
mscott%netscape.com
c438ffca68 added a url dispatching comment.
git-svn-id: svn://10.0.0.236/trunk@51953 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:19 +00:00
sfraser%netscape.com
5258fa6070 Another teeny project fix -- remove obsolete lib/xp paths in the two static targets (which are not built anyway). r=moose
git-svn-id: svn://10.0.0.236/trunk@51952 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:44:44 +00:00
sfraser%netscape.com
f825fcb394 Fix the output file (RDF.header -> chrome.headers) so that .h file generation dependencies work properly. Fixes the red tree. r=mscott
git-svn-id: svn://10.0.0.236/trunk@51951 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:42:07 +00:00
rpotts%netscape.com
072f7a0e0b These are pollmanns changes for bug #8209 and other related POSTing bugs r=rpotts
git-svn-id: svn://10.0.0.236/trunk@51950 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:35:03 +00:00
mcafee%netscape.com
f3b4ca8e81 switching to absolute leak/bloat numbers.
git-svn-id: svn://10.0.0.236/trunk@51949 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:34:28 +00:00
sfraser%netscape.com
e48c7f6f32 Really change to using the NSComponent library. the opt target still had NSStartup. r=moose.
git-svn-id: svn://10.0.0.236/trunk@51948 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:31:40 +00:00
pavlov%netscape.com
30d2acfd1b check for null r=alecf
git-svn-id: svn://10.0.0.236/trunk@51944 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 05:51:05 +00:00
putterman%netscape.com
6263816942 Fix for 17277. reviewed by mscott. Delete selects next message instead of previous.
git-svn-id: svn://10.0.0.236/trunk@51942 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 04:46:12 +00:00
bienvenu%netscape.com
226d2a5c5f add accessor for load group on doc loader r=rpotts
git-svn-id: svn://10.0.0.236/trunk@51941 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 04:44:42 +00:00
troy%netscape.com
fd1d6fc2a3 Changed view to be stored as a frame property instead of a member data
of nsFrame


git-svn-id: svn://10.0.0.236/trunk@51940 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:56:14 +00:00
mccabe%netscape.com
f192186834 Undo overly-hasty backout. This reinstates part of my recent checkin.
git-svn-id: svn://10.0.0.236/trunk@51939 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:44:38 +00:00
saari%netscape.com
a9ec68967c Making popups not steal activation on MacOS. r: pinkerton, no bug number that I'm aware of
git-svn-id: svn://10.0.0.236/trunk@51938 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:32:35 +00:00
tbogard%aol.net
1d0ea94a3d Create an initialization structure to hold data until window created. Added a lot of implementation for many of the accessors. Filled in a lot of other first cut implementation.
git-svn-id: svn://10.0.0.236/trunk@51936 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:45:49 +00:00
tbogard%aol.net
144854adac For some reason to get an nsRect implementation you have to link with gfx. Yeah, that's componentized!
git-svn-id: svn://10.0.0.236/trunk@51935 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:49 +00:00
beard%netscape.com
98fb6ecb62 make warnings not terminate build. fix bustage, r=mccabe
git-svn-id: svn://10.0.0.236/trunk@51934 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:34 +00:00
tbogard%aol.net
d23ee135fa Boundary checking.
git-svn-id: svn://10.0.0.236/trunk@51933 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:01 +00:00
tbogard%aol.net
7c66962d85 A little more documentation.
git-svn-id: svn://10.0.0.236/trunk@51932 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:43:37 +00:00
hyatt%netscape.com
4639154a7f making the chrome registry work with dynamic overlays r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51931 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:21:05 +00:00
mccabe%netscape.com
8522d5db78 Debust mac-specific \r-related tree breakage.
git-svn-id: svn://10.0.0.236/trunk@51927 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 01:28:59 +00:00
troy%netscape.com
c04dab44f6 Change to some assertions in debug mode
git-svn-id: svn://10.0.0.236/trunk@51925 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:53:15 +00:00
mccabe%netscape.com
cde9269c1b Various fixes to xpidl. Note that this checkin will cause a rebuild of everything that depends on nsISupports.h. Fixes courtesy Mike Shaver, with small tweaks by McCabe. r=shaver, r=mccabe.
- Fix to bug 17013; have xpidl produce an error when encountering a native declaration without an associated (c++-name).

- remove many DEBUG_shaver lines.

- provide xpidl_tree_warning as a fallback for libIDL versions for which IDL_tree warning is bad, and NULL-proof our message callback function.  Also remove a 1k buffer limit from the message callback function.

- make enum in IDL files an error.  We don't support it, and love consts instead.

- Fix to 12684; don't allow [retval] parameter + return or multiple [retval] parameters.

- Fix to 13390; make non-{short,long} const a fatal error.


git-svn-id: svn://10.0.0.236/trunk@51924 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:37:39 +00:00
hangas%netscape.com
825694f714 Fixed the order of the stop and reload buttons on the browser. r=german
git-svn-id: svn://10.0.0.236/trunk@51923 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:17:16 +00:00
ftang%netscape.com
94bc1e8092 add debugging code. change code so we won't call MapDBCSAttributeArrayToUnicodeOffsets when we are not composition. Sent length == 0 TextEvent if we got nothhing in IME_COMPOSITION. This is needed to delete the last unconverted text in IME. r=tague
git-svn-id: svn://10.0.0.236/trunk@51922 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:14:46 +00:00
ftang%netscape.com
1a8b9b5ddb implement input method highlight. r=tague
git-svn-id: svn://10.0.0.236/trunk@51921 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:10:03 +00:00
jj%netscape.com
e14a41074a workaround to accept wildcards on Mac -- granrose. r=jj
git-svn-id: svn://10.0.0.236/trunk@51918 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:03:54 +00:00
rods%netscape.com
beb6aa3e8b At kipp's suggestion I added a EnterReflowLock before and a ExitReflowLock
after my AppendReflowCommand. The reflow command gets "kicked off"
and it is now fixed. r=kipp, b=14771


git-svn-id: svn://10.0.0.236/trunk@51916 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:34:46 +00:00
sspitzer%netscape.com
71d282e592 fix for #17212, r=mscott.
migrate imap servers that have the port in the name (like nsmail-2:143)


git-svn-id: svn://10.0.0.236/trunk@51915 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:34:30 +00:00
rods%netscape.com
d8ca5cd972 removed an unused variable and an extra decl and call to remove two warnings
r=none


git-svn-id: svn://10.0.0.236/trunk@51914 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:28:51 +00:00
mccabe%netscape.com
2cdb9d67e3 Fix IDL to use native <idl-name>(<C++-name>); instead of just native <idl-name>; This is prep to make the tree compile with a new error mode landing in xpidl shortly.
Preperatory to a fix to 17013; I'm doing this as a separate checkin to avoid any checkin-skew danger.

r=shaver.


git-svn-id: svn://10.0.0.236/trunk@51913 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:26:28 +00:00
rods%netscape.com
bdb148b62f changed param in the initializer to aContent instead of nsnull
r=kmcclusk,b=17015


git-svn-id: svn://10.0.0.236/trunk@51912 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:21:14 +00:00
gagan%netscape.com
22e24a8da0 Fixed bugs 11677 (perf) 13837 (spaces) 14380 (leading spaces) 14707 (-1) 15069 (file://) r=valeski
git-svn-id: svn://10.0.0.236/trunk@51911 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:16:34 +00:00
cmanske%netscape.com
3054ed7de9 Fixed bugs 6278, 9758, 17014, 17071, 17160. r=sfraser,mjudge
git-svn-id: svn://10.0.0.236/trunk@51910 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:13:00 +00:00
mcafee%netscape.com
214b95844f Clear alarm from AliveTest, this was causing alternating green/orange status. Thanks to alecf/slamm for debugging help.
git-svn-id: svn://10.0.0.236/trunk@51909 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:10:35 +00:00
cmanske%netscape.com
f92e65e679 Part of fix for 17160, remove TextEditor from Tasks menu. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51908 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:07:41 +00:00
rhp%netscape.com
013f4b1591 Cleaning up some comments.
git-svn-id: svn://10.0.0.236/trunk@51907 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:06:27 +00:00
tbogard%aol.net
bb01dd252a Implemented the Destroy() method.... Which basically boils down to us returning out that we don't support the method. :)
git-svn-id: svn://10.0.0.236/trunk@51905 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:59:33 +00:00
wtc%netscape.com
f6437b73b9 Bugzilla bug #17188: NSPR should not automatically set the SO_KEEPALIVE
socket option on a new TCP socket. The HAVE_SOCKET_KEEPALIVE macro is
obsolete. r=srinivas@netscape.com.
Modified files: _beos.h, _os2.h, _unixos.h, _win16.h, _win95.h, _winnt.h,
prsocket.c, and ptio.c.


git-svn-id: svn://10.0.0.236/trunk@51902 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:58:55 +00:00
tbogard%aol.net
9e1e7d7a18 Implemented a number of methods for the doc shell attributes. Setup and Init structure which is used to accept the settings of attributes until Create() is called.
git-svn-id: svn://10.0.0.236/trunk@51900 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:56:59 +00:00
rhp%netscape.com
428cbd6498 Update changes for Mac project...again
git-svn-id: svn://10.0.0.236/trunk@51898 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:56:18 +00:00
tbogard%aol.net
0701f384c9 Updated some of the documentation.
git-svn-id: svn://10.0.0.236/trunk@51895 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:54:26 +00:00
rhp%netscape.com
3aa41ccbdf Update changes for Mac project
git-svn-id: svn://10.0.0.236/trunk@51894 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:47:55 +00:00
norris%netscape.com
0949cbb8b9 Fix 16836 "Security error accessing DOM elements inside an IFrame"
r=vidur@netscape.com
Also, bug 16536 "Security disallows opening resource URL" no longer occurs after this fix.


git-svn-id: svn://10.0.0.236/trunk@51893 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:45:32 +00:00
rhp%netscape.com
0d96648b4a Changes for better text display and format flowed - Bug #16507 - r: rhp since this is externally contributed
git-svn-id: svn://10.0.0.236/trunk@51892 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:43:25 +00:00
pinkerton%netscape.com
ae7c4c1605 File Removed.
git-svn-id: svn://10.0.0.236/trunk@51891 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:38:54 +00:00
pinkerton%netscape.com
884c5020ad use new chrome idl project instead of generated header file (r=hyatt).
git-svn-id: svn://10.0.0.236/trunk@51890 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:38:40 +00:00
pinkerton%netscape.com
3ef9a724a2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51889 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:37:45 +00:00
slamm%netscape.com
50be5003d6 Add entity for bookmarks menu on personal toolbar
git-svn-id: svn://10.0.0.236/trunk@51888 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:10:15 +00:00
varada%netscape.com
2c49380653 fixes for bug #8977 9097
git-svn-id: svn://10.0.0.236/trunk@51887 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:07:57 +00:00
valeski%netscape.com
89e72a3976 fixing bustage
git-svn-id: svn://10.0.0.236/trunk@51886 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:07:50 +00:00
jj%netscape.com
699e8eca27 File Removed.
git-svn-id: svn://10.0.0.236/trunk@51885 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:53:43 +00:00
dougt%netscape.com
d11e61e41f People will not like to see my debugging info about object retention. Remov
ing #define.


git-svn-id: svn://10.0.0.236/trunk@51884 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:44:02 +00:00
brade%netscape.com
f6a4506783 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51883 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:27:05 +00:00
terry%mozilla.org
02502d0c41 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51882 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:14:01 +00:00
varada%netscape.com
abe68f9fc4 fixing string.ini for online help from show example
git-svn-id: svn://10.0.0.236/trunk@51881 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:13:16 +00:00
varada%netscape.com
c1d12e4258 fixing checklist.ini for online help
git-svn-id: svn://10.0.0.236/trunk@51880 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:12:56 +00:00
varada%netscape.com
ff6e49dbb9 fix for bug#10810 if Help=Online;url is included in the ini file then the online help is launched with that url
git-svn-id: svn://10.0.0.236/trunk@51879 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:10:39 +00:00
valeski%netscape.com
f94df2ee59 17270, r=dougt@netscape.com. These changes move FTP from interface pointers to COMptrs. There is also a variable name change, mUrl -> mURL. Also some extraneous pipe code has been removed.
git-svn-id: svn://10.0.0.236/trunk@51878 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:55:50 +00:00
mstoltz%netscape.com
c48a5396a0 Fixed Windows breakage from converting const nsZIpItem* to nsZipItem*. r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51877 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:45:21 +00:00
mscott%netscape.com
a29d572364 Bug #14928 -- > url dispatching. Change DoContent to return a stream listener instead of
a nsIContentViewer.
r=travis


git-svn-id: svn://10.0.0.236/trunk@51876 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:35:21 +00:00
rogerl%netscape.com
1aa494ee2b Changed from pic to PIC for Solaris build per Vishy.
git-svn-id: svn://10.0.0.236/trunk@51875 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:34:55 +00:00
pinkerton%netscape.com
9cbdc1b888 add case for unicode flavor, which i guess was forgotten before. now apps that request unicode get unicode. bug# 16267 r=hyatt/pav. thanks to VYV03354@nifty.ne.jp for pointing this out.
git-svn-id: svn://10.0.0.236/trunk@51874 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:33:30 +00:00
pinkerton%netscape.com
3490b579c3 Cleaned up the code and fixed a bug where data was not being null terminated on winNT.
partial fix for bug #16267 (r=hyatt/pav).


git-svn-id: svn://10.0.0.236/trunk@51873 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:31:54 +00:00
ftang%netscape.com
4c6ccd7e59 change #ifdef DEBUG_tague to #if defined(DEBUG_tague) || defined(DEBUG_ftang)
git-svn-id: svn://10.0.0.236/trunk@51872 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:17:36 +00:00
nhotta%netscape.com
643eb34912 Unicode encoder related change for unmapped characters.
If unicode encoder cannot map a character to the target encoding, it returns used unicode length including the unmapped character.
That is true for all encoder except ISO-2022-JP (bug #15706). Changed the callers to match the encoder behavior. bug 8865, r=cata.


git-svn-id: svn://10.0.0.236/trunk@51871 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:16:11 +00:00
ftang%netscape.com
a72076d654 fix IME assertion problem . r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@51870 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:04:47 +00:00
putterman%netscape.com
8189fffdfb No bug. reviewed by bienvenu. OnKeyDeleted wasn't sending the correct parent
thread value because the message was being deleted before we saved off the parent.


git-svn-id: svn://10.0.0.236/trunk@51869 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:52:20 +00:00
slamm%netscape.com
861592dd89 Tweak sidebar styles. r=german.
git-svn-id: svn://10.0.0.236/trunk@51868 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:45:25 +00:00
dougt%netscape.com
f769dc5560 merging FILESEP and DIRECTORY_SEPARATOR. they both do the same thing.
git-svn-id: svn://10.0.0.236/trunk@51867 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:45:18 +00:00
slamm%netscape.com
595ab124a0 Use real separator on personal toolbar menus. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51866 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:44:22 +00:00
slamm%netscape.com
7d6ce80686 Add bookmarks button (bug #14502) to personal toolbar. Fix spacing of buttons on personal toolbar. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51865 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:43:32 +00:00
mstoltz%netscape.com
ea05167e43 Added GetInputStream function to nsJAR in order to extract files into memory rather than to disk. Created nsJARInputStream to carry this data. Most of the code for this change went into nsZipArchive, which now handles either file output or output to memory. bug=16077 r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51864 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:43:26 +00:00
dougt%netscape.com
94bbe207a4 Cleanup.
Removing convertTo* routines

Not hooked up to build yet.


git-svn-id: svn://10.0.0.236/trunk@51863 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:34:56 +00:00
dougt%netscape.com
c10be2aa21 1) Change ownership model internally. (17009)
2) Fixed IMAP password dialog problems by adding a PR_SLEEP() in
   nested event loop.
3) Now using a pushed event loop.

r=valeski, mscott.


git-svn-id: svn://10.0.0.236/trunk@51862 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:30:50 +00:00
valeski%netscape.com
6f9e12e047 17144. api change to nsIIOService.idl made last night missed the javascript caller in here
git-svn-id: svn://10.0.0.236/trunk@51861 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:08:10 +00:00
nhotta%netscape.com
b6cdf6cb47 Added charset propertiy files so the charset conversion to work properly (for win and mac, unix didn't have the problem), 17254, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51860 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:06:41 +00:00
jfrancis%netscape.com
bb138b3c5c reworking editor IME supoprt; r=kin; bugs: 13576, 11878, 11994, 13494, 16432
git-svn-id: svn://10.0.0.236/trunk@51859 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 18:54:47 +00:00
rhp%netscape.com
b4e2e646cf Just adding new files...NOT PART OF THE BUILD!
git-svn-id: svn://10.0.0.236/trunk@51858 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 18:50:08 +00:00
despotdaemon%netscape.com
cceb1924b6 Pseudo-automatic update of changes made by mcs@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51857 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:55:28 +00:00
norris%netscape.com
e544596aa2 Remove method duplication in NativeGlobal.
Add javadoc comments to EcmaError.


git-svn-id: svn://10.0.0.236/trunk@51856 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:22:23 +00:00
norris%netscape.com
9be2ae4e35 Get filename and line number into uncaught exception reports.
git-svn-id: svn://10.0.0.236/trunk@51855 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:06:12 +00:00
slamm%netscape.com
0f3c71a001 Need path to gunzip. This should be configured.
git-svn-id: svn://10.0.0.236/trunk@51854 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 16:56:00 +00:00
terry%mozilla.org
4f2f6dae6d Update version to 1.3 (which means unstable, tip-of-CVS version).
git-svn-id: svn://10.0.0.236/trunk@51853 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:49:58 +00:00
terry%mozilla.org
8f7faa2f78 Fixed perl error caused by previous change.
git-svn-id: svn://10.0.0.236/trunk@51852 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:48:25 +00:00
terry%mozilla.org
abfa77727b Make version number be 1.2, we will be spinning a tarball.
git-svn-id: svn://10.0.0.236/trunk@51850 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:37:12 +00:00
vidur%netscape.com
1291c59ad4 Replaced delete operator calls with Recycle(). R=joki
git-svn-id: svn://10.0.0.236/trunk@51849 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:56:41 +00:00
vidur%netscape.com
252d9255a6 Switched HTML content sink to be more incremental in content creation. Fixes bugs 11141, 854, et. al. R=kipp
git-svn-id: svn://10.0.0.236/trunk@51848 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:55:51 +00:00
dcone%netscape.com
73c37400ce Added a clip for the borders and fixed how they are rendered. r=karnaze
bugs:10311,8737,14566


git-svn-id: svn://10.0.0.236/trunk@51847 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:34:17 +00:00
rods%netscape.com
e181f8b3fa addedmore tests
git-svn-id: svn://10.0.0.236/trunk@51846 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:16:15 +00:00
rods%netscape.com
6c5ee72d6b initial add
git-svn-id: svn://10.0.0.236/trunk@51845 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:15:51 +00:00
rods%netscape.com
aaced0b882 The button "active" state needed one more pixel width in the border
r=dcone,b=17154


git-svn-id: svn://10.0.0.236/trunk@51844 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:05:49 +00:00
warren%netscape.com
7230bc55ee Fixed NewChannel to pass null for new originalURL argument.
git-svn-id: svn://10.0.0.236/trunk@51843 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 10:37:37 +00:00
hyatt%netscape.com
2d7de08a49 more stubbing out of dynamic overlays r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51842 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 10:03:13 +00:00
tbogard%aol.net
ca83b4534f Added a CanHandleContentType to identify if a given instantiated docShell can handle the requested document type.
git-svn-id: svn://10.0.0.236/trunk@51841 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:51:36 +00:00
warren%netscape.com
b9f22ce6f8 Fixed missed change to NewInputStreamChannel
git-svn-id: svn://10.0.0.236/trunk@51840 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:51:01 +00:00
warren%netscape.com
fe1c294273 Added nsIChannel::GetOriginalURI so that we can get back to the original chrome file (bug#17144). r=rpotts,mscott
git-svn-id: svn://10.0.0.236/trunk@51839 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:16:24 +00:00
endico%mozilla.org
7ecb2f45fd make the grep for server error not so noisy 2>&1
git-svn-id: svn://10.0.0.236/trunk@51838 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:37:07 +00:00
hyatt%netscape.com
1ca2484933 change from strings to URIs r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51837 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:21:32 +00:00
hyatt%netscape.com
f54d64efad stubbing out dynamic overlay loading and converting chrome registry to IDL r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51836 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:13:25 +00:00
mscott%netscape.com
2e56fd5c66 Bug #14928 --> url dispatching. convert nsIContentHandler.idl, nsIURIDispatcher.idl and nsIContentListener.idl
into .h files.
no reviewer yet. the code review for url dispatching will come later.


git-svn-id: svn://10.0.0.236/trunk@51835 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 07:11:44 +00:00
mscott%netscape.com
bd9b666efc Bug #14928 --> first pass at several key interfaces for url dispatching.
Not part of the build and no reviewer yet. The review will come later on when we review url dispatching


git-svn-id: svn://10.0.0.236/trunk@51834 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 07:10:27 +00:00
slamm%netscape.com
a174cc125d New sidebar ui. One panel open at a time. No bug (yet...). r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51832 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 05:46:00 +00:00
ramiro%fateware.com
2f58cc8fd3 Fix the invocation of regxpcom.
git-svn-id: svn://10.0.0.236/trunk@51831 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 05:42:33 +00:00
rpotts%netscape.com
58b6be1d08 Cleanup - changed setter/getter methods to an attribute.
git-svn-id: svn://10.0.0.236/trunk@51830 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:49:56 +00:00
rpotts%netscape.com
4c6919a678 Added CancelPendingChannel(...) which allows a nsHTTPChannel to remove itself from the list of pending requests if it is cancelled... This was causing a leak :-(
git-svn-id: svn://10.0.0.236/trunk@51829 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:49:23 +00:00
rpotts%netscape.com
1d93a7a7ae Cleanup - Moved the PostData stream from the nsHTTPChannel to the nsHTTPRequest... The PostStream is now released once the request has been sent to the server since it is no longer useful. Fixed up Cancel to remove the channel from the list of pending requests if necessary.
git-svn-id: svn://10.0.0.236/trunk@51828 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:48:26 +00:00
rpotts%netscape.com
dc04d4b53b Cleanup - Removed NSPIPE2 ifdefs. Fixed up the nsHTTPResponse constructor which no longer takes a nsIInputStream.
git-svn-id: svn://10.0.0.236/trunk@51827 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:45:03 +00:00
troy%netscape.com
bd46e7911f Changed SetView/GetView to take an additional argument which is the
pres context


git-svn-id: svn://10.0.0.236/trunk@51822 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:44:41 +00:00
rpotts%netscape.com
a3b472c211 Cleanup - Removed unused methods and members. Changed char* member to nsCString
git-svn-id: svn://10.0.0.236/trunk@51821 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:43:19 +00:00
rods%netscape.com
3c48aa841c minor changes to previous checkin to handle css sizing like NavQuirks
b=6695,r=none


git-svn-id: svn://10.0.0.236/trunk@51820 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:29:20 +00:00
mcafee%netscape.com
3b76676f40 Moved process killing stuff into killproc(), added alarm timeout for bloattest. code=alecf, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51819 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:07:03 +00:00
rods%netscape.com
8aef13e868 Completely rewrote the the Reflow for gfx text controls, factored out separate
reflow paths for NavQuirks and Standard mode. Also, Standard mode reflow now obeys
cols rows etc. Although there may be a little code bloat, this will make maintaining
the input text and textarea much much easier.
r=kmcclusk, b=6695,7461


git-svn-id: svn://10.0.0.236/trunk@51818 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 03:46:18 +00:00
pollmann%netscape.com
052a729260 Bug 17079: URL encoding of form element values should convert + to %2B and / as needed: r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@51817 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 03:08:17 +00:00
morse%netscape.com
4b5a4b8e5d code cleanup, r=rickg
git-svn-id: svn://10.0.0.236/trunk@51816 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:46:34 +00:00
nisheeth%netscape.com
aea3ade8fe Follow-up to fix for bug 10456. I made the earlier changes to the non-Necko part of the code! Making the same changes to the ifdef NECKO part.
git-svn-id: svn://10.0.0.236/trunk@51815 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:42:23 +00:00
tbogard%aol.net
2e96f47e2e Changed nsIProgress::addListener and nsIWebBrowser::addListener to be addProgressListener and addWebBrowserListener respectively. This is to avoid confusing name conflicts. Implemented nsIWebBrowser::GetDocument() and nsIWebBrowser::GetDocShell().
git-svn-id: svn://10.0.0.236/trunk@51814 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:37:14 +00:00
tbogard%aol.net
254fe24a86 Removed nsIWebBrowserListener in favor of the new more generic nsIInterfaceRequestor. Added some interface boundary parameter validation. Added implementation for add and remove listener.
git-svn-id: svn://10.0.0.236/trunk@51813 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:26:57 +00:00
tbogard%aol.net
566e36cc10 Added some documentation.
git-svn-id: svn://10.0.0.236/trunk@51812 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:23:38 +00:00
sgehani%netscape.com
499a258aa7 Fixes bug 11209: we now detect free space larger than 2^32 bytes in the Install Wizard. [r=cathleen]
git-svn-id: svn://10.0.0.236/trunk@51811 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:12:00 +00:00
sgehani%netscape.com
95d88cbf7b Fixes bug 17190: extract only core_*/* files to obtain the XPInstall engine run by the Install Wizard. [r=cathleen]
git-svn-id: svn://10.0.0.236/trunk@51810 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:08:56 +00:00
wtc%netscape.com
f8f5eb822d Added missing function declarations to eliminate compiler warnings.
Checked in on behalf of Colin Blakes <colin@theblakes.com>.


git-svn-id: svn://10.0.0.236/trunk@51809 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:01:38 +00:00
nisheeth%netscape.com
aef9243c78 Bugs 10456, 15027, 11948. r=harishd. We no longer try to load up external DTD files unless those DTD files are referred to via a chrome url.
git-svn-id: svn://10.0.0.236/trunk@51808 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:58:41 +00:00
wtc%netscape.com
be5e5badd8 Bugzilla bug #17184: PR_Bind should not set the SO_REUSEADDR socket
option.  The HAVE_SOCKET_REUSEADDR macro is now obsolete.  Tests
that depended on the old PR_Bind behavior needs to call PR_SetSocketOption
before PR_Bind.
Modified files: _beos.h, _os2.h, _unixos.h, _win16.h, _win95.h, _winnt.h,
prsocket.c, ptio.c, accept.c, acceptread.c, sel_spd.c, servr_kk.c,
servr_ku.c, servr_uk.c, and servr_uu.c.


git-svn-id: svn://10.0.0.236/trunk@51807 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:58:10 +00:00
pavlov%netscape.com
bca7914d4c merge some changes that got dropped somehow during the landing r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51806 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:54:39 +00:00
tbogard%aol.net
67f77212c6 Updated to use new nsDocShellBase class. Removed a bunch of code from this level so it instead can be pulled from the base class.
git-svn-id: svn://10.0.0.236/trunk@51802 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:46:22 +00:00
tbogard%aol.net
2541c54b1d Added basedocshell library to the list of bound libraries.
git-svn-id: svn://10.0.0.236/trunk@51801 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:45:11 +00:00
tbogard%aol.net
97c0df855a Created a base class library that will provide the shared docShell implmentation.
git-svn-id: svn://10.0.0.236/trunk@51800 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:44:00 +00:00
slamm%netscape.com
10813277ec Fix typo.
git-svn-id: svn://10.0.0.236/trunk@51799 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:40:23 +00:00
tbogard%aol.net
04e0ba7204 added files: mozilla/xpcom/base/nsIInterfaceRequestor.idl
git-svn-id: svn://10.0.0.236/trunk@51798 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:37:45 +00:00
tbogard%aol.net
67b737d3e4 Adding nsIInterfaceRequestor.idl to the list of built IDL files.
git-svn-id: svn://10.0.0.236/trunk@51797 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:37:29 +00:00
waqar%netscape.com
17e91e8ab8 # 15904
r vidur
d fixes a problem where first character of the comment was being destroyed.


git-svn-id: svn://10.0.0.236/trunk@51796 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:30:55 +00:00
edburns%acm.org
4dcff0c574 r=edburns@acm.org
author=idk@eng.sun.com
#16149
approver=edburns@acm.org


git-svn-id: svn://10.0.0.236/trunk@51795 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:29:09 +00:00
mccabe%netscape.com
0683dd99f5 Initial checkin of mozbot code-reviewing functionality.
git-svn-id: svn://10.0.0.236/trunk@51794 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:22:00 +00:00
Jerry.Kirk%Nexwarecorp.com
d6610d45df Trying to fix complex clipping to reduce redraws in apprunner.
Also fixed key handling for CTRL-keys.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51793 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:13:20 +00:00
scc%netscape.com
6f74b3fb2f Don't |delete| interface pointers. Use |AddRef()| and |Release()| instead. Bug #16762, r=pinkerton.
git-svn-id: svn://10.0.0.236/trunk@51792 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:49:33 +00:00
Jerry.Kirk%Nexwarecorp.com
18c97ff34d Fixing problem with &nbsp; being put into empty text fields
This is relly more of a hack, not a fix.
Bug 16886	r=kedl


git-svn-id: svn://10.0.0.236/trunk@51791 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:45:24 +00:00
Jerry.Kirk%Nexwarecorp.com
b7f540b9f2 Pulling out changes that made nsAppShell inherit from nsIObserver
that danm thought I should make cause he changed his mind.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51790 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:42:08 +00:00
hangas%netscape.com
08883ca9a8 new ui. r=pavlov,german,hyatt
git-svn-id: svn://10.0.0.236/trunk@51789 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:39:19 +00:00
sgehani%netscape.com
7eccb655b3 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51788 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:35:41 +00:00
sgehani%netscape.com
bf1287cb0c *** NOT PART OF BUILD ***
Added ASEncoder tool -- AppleSingle encoder and decoder -- with two interfaces: 

1> Menu and file selector based GUI
2> AppleScript interface (or callable from any OSA compliant scriptable component)

Fixes bug: 16947.


git-svn-id: svn://10.0.0.236/trunk@51787 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:34:40 +00:00
pinkerton%netscape.com
a5ef534d81 fix leak of grippy structs when toolbox went away. (r=bienvenu).
git-svn-id: svn://10.0.0.236/trunk@51786 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:22:48 +00:00
ducarroz%netscape.com
6d43e18270 Checking it again as for reason, the file I've checked in last time is corrupted.
git-svn-id: svn://10.0.0.236/trunk@51785 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:16:33 +00:00
jefft%netscape.com
002757422d fixed bug 17176 -- [DOGFOOD] [Reqression] Can't save attachment; we are not generating message uri correctly; r=mscott
git-svn-id: svn://10.0.0.236/trunk@51784 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:07:27 +00:00
bienvenu%netscape.com
b361c28994 turn off meteors and spinning barber pole for now r=mscott
git-svn-id: svn://10.0.0.236/trunk@51783 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:45:19 +00:00
ssu%netscape.com
719cf747d3 updated/added/removed install error values to accomodate the fileop
routines checked in over the weekend. r=sgehani.


git-svn-id: svn://10.0.0.236/trunk@51782 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:44:09 +00:00
ducarroz%netscape.com
e45bf9a654 Fix build bustage for nhotta
git-svn-id: svn://10.0.0.236/trunk@51781 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:29:24 +00:00
nhotta%netscape.com
bcc540225b Changed unicode conversion for mail send.
Added a fallback for unmapped characters, moved entity conversion after the unicode conversion as the fallback, avoided to convert twice for text/html case, part of bug fix 15475, r=rhp.


git-svn-id: svn://10.0.0.236/trunk@51780 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:21:30 +00:00
ssu%netscape.com
879c9f145f fixed parameter problem during compilation for sgehani. r=sgehani
git-svn-id: svn://10.0.0.236/trunk@51779 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:16:46 +00:00
kipp%netscape.com
3cbf0c252a Added missing resources
git-svn-id: svn://10.0.0.236/trunk@51778 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:06:05 +00:00
sgehani%netscape.com
32a0978c7e Fix for bug 17137: added complete and abort routines for mac alias creation XPInstall API. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@51777 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:44 +00:00
kipp%netscape.com
60ea075c3f Reduce the number of cases that trigger noisy debug noise
git-svn-id: svn://10.0.0.236/trunk@51776 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:31 +00:00
kipp%netscape.com
dfe78df5d9 Turned off some more debug noise
git-svn-id: svn://10.0.0.236/trunk@51775 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:15 +00:00
kipp%netscape.com
4bb755ead2 r=ftang,brade, bug=16886,9101 - the text transformer was letting some nbsp's through in a few special cases; the text transformer also squelches shy characters now (9101)
git-svn-id: svn://10.0.0.236/trunk@51774 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:04:51 +00:00
kipp%netscape.com
ae6b64e566 r=troy, bug=10497; we now support min/max width/height for image elements
git-svn-id: svn://10.0.0.236/trunk@51773 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:03:50 +00:00
kipp%netscape.com
df248f10b1 Quieted down some debug noise and added a missing newline to a printf
git-svn-id: svn://10.0.0.236/trunk@51772 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:02:43 +00:00
law%netscape.com
6f73e6604a Bug #14999; last holdout that was using toolkit app core - changed to use OpenDialog; r=davidm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51771 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:02:05 +00:00
dougt%netscape.com
11d905c2a9 ack! what was I thinking.
#ifdef'ing not including!!


git-svn-id: svn://10.0.0.236/trunk@51770 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:57:40 +00:00
morse%netscape.com
8bd629f104 fix bug 17172 -- wrong cookie is displayed, r=goodsger
git-svn-id: svn://10.0.0.236/trunk@51769 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:56:24 +00:00
kmcclusk%netscape.com
9bb05775e0 Register nsFormProcessor service to exercise nsIFormProcessor interface.
bug 17060. r=karnaze@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51768 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:54:12 +00:00
karnaze%netscape.com
f98a03f3ac bug 16284, 14159 nested auto table with percent cells was not growing auto table. nested coord or percent table was only getting min size.
git-svn-id: svn://10.0.0.236/trunk@51767 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:49:51 +00:00
dougt%netscape.com
bb554f06d2 adding nsIFile to nsXPComInit. Currently it is #ifdef'ed off.
bug 13320


git-svn-id: svn://10.0.0.236/trunk@51766 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:48:44 +00:00
kmcclusk%netscape.com
2f7a2a20da Call nsIFormProcessor service if it has been registered for each value submitted.
bug=17060 r=karnaze@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51765 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:48:43 +00:00
dougt%netscape.com
49cd195acc changed license.
git-svn-id: svn://10.0.0.236/trunk@51764 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:45:56 +00:00
dougt%netscape.com
ea0c601803 Initial checkin of nsIFile test. bug 13320. r=dougt
Not hooked up to build, yet.


git-svn-id: svn://10.0.0.236/trunk@51763 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:45:12 +00:00
dougt%netscape.com
a2ec5f969a Initial checkin of nsIFile windows implementation. bug 13320. r=dougt
Not hooked up to build, yet.


git-svn-id: svn://10.0.0.236/trunk@51762 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:44:42 +00:00
akhil.arora%sun.com
bb01f7852c 15579 r=akhil.arora@sun.com Checkin by Igor Nekrestyanov <nis@sparc.spb.su>
Implementation of DOM Events from the W3c DOM Level 2 current working draft


git-svn-id: svn://10.0.0.236/trunk@51761 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:42:40 +00:00
dougt%netscape.com
6c8ce03672 adding a progID and className. r=me.
NOT PART OF THE BUILD, YET


git-svn-id: svn://10.0.0.236/trunk@51760 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:33:55 +00:00
dougt%netscape.com
6839959ccf Change net module notification to make proxies lazy. r=dveditz, mozbot.
This reduces memory overhead.


git-svn-id: svn://10.0.0.236/trunk@51759 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:31:59 +00:00
tbogard%aol.net
ae51cb2bce Added new nsIInterfaceRequestor interface. r=dp
git-svn-id: svn://10.0.0.236/trunk@51758 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:31:40 +00:00
law%netscape.com
168d68ed9c Bug #14999; use OpenDialog instead of toolkit app core; r=radha@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51757 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:30:40 +00:00
kmcclusk%netscape.com
64e09df2b9 Export nsIFormProcessor.h on Mac. bug=17060; r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51756 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:29:22 +00:00
norris%netscape.com
a6a5735f6c Fix 11963 Need security controls on javascript: urls
r=mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51755 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:23:25 +00:00
norris%netscape.com
68023d9210 Use NS_GET_IID, remove dead code, clean up error conditions for XPConnect security calls.
r=jband


git-svn-id: svn://10.0.0.236/trunk@51754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:22:16 +00:00
norris%netscape.com
2c73987122 Expose referrer from web shell.
r=travis
needed for bug 11963.


git-svn-id: svn://10.0.0.236/trunk@51753 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:20:10 +00:00
ftang%netscape.com
80f773ac31 fix not enough gap between IME selection problem. r=erik
git-svn-id: svn://10.0.0.236/trunk@51752 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:18:41 +00:00
ftang%netscape.com
13ed9a026b delete nsTextRange array after dispatch the text event. fix wrong array indexing. Fix platform to NS attribute mapping problem. r=tague
git-svn-id: svn://10.0.0.236/trunk@51751 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:17:09 +00:00
rods%netscape.com
2c0b3223a2 Export nsIFormProcessor.h on Linux. bug=17060 r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51750 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:14:21 +00:00
rhp%netscape.com
a2e9eb0c8e Fix for extra conversion - r: nhotta
git-svn-id: svn://10.0.0.236/trunk@51749 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:13:39 +00:00
akkana%netscape.com
b3f6f6906c 15463: Re-enable XIM code, add keycode mappings for shifted characters
git-svn-id: svn://10.0.0.236/trunk@51748 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:11:23 +00:00
putterman%netscape.com
2a9fdcf10a Fixes 12894. Messages show up bold again if they are unread. reviewed by bienvenu.
git-svn-id: svn://10.0.0.236/trunk@51747 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:10:32 +00:00
alecf%netscape.com
6436fc3afa fix for #17187 - return NS_RDF_NO_VALUE when any particular GetTarget() calls fail
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@51746 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:09:07 +00:00
kmcclusk%netscape.com
cee3171b28 Removed build warning caused by overloaded GetDesiredSize. bug=15575. r=buster@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51745 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:06:41 +00:00
nhotta%netscape.com
58f8c6d8d9 Added MsgUtil.lib and MsgUtilDebug.lib to the project, part of bug fix 15475.
git-svn-id: svn://10.0.0.236/trunk@51744 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:04:23 +00:00
nhotta%netscape.com
b5fc1e2670 Changed MIME header encoder in unicode conversion. Instead of skipping unmapped characters,
call the fallback funcion (puts a question mark for an unmapped char), part of bug fix 15475, r=rhp.


git-svn-id: svn://10.0.0.236/trunk@51743 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:03:09 +00:00
putterman%netscape.com
c473237102 Fix 17107. A bunch of view navigation bugs. Reviewed by bienvenu. It fixes:
1.  Next message with no selection finds the next message
2.  It no longer redisplays current message if Next Message finds no next message.
3.  Next/Previous message works if last/first message is selected.


git-svn-id: svn://10.0.0.236/trunk@51742 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:02:58 +00:00
kmcclusk%netscape.com
3a21a346ef Export nsIFormProcessor.h. bug=17060. r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51741 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:01:19 +00:00
kmcclusk%netscape.com
389e1be499 First time checked in. Used to provide data during form submission. bug 17060. r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51740 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:59:39 +00:00
brade%netscape.com
b77f113bda fix plain text editor (r=cmanske@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51739 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:57:11 +00:00
brade%netscape.com
56be896120 fix plain text editor (r=cmanske@netscape.com, jfrancis@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51738 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:56:37 +00:00
nisheeth%netscape.com
427d3f559c Ongoing work to get macros for timing modules up and running. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@51737 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 20:59:35 +00:00
jefft%netscape.com
86ba1460c9 fixed bug 17179 -- [dogfood] [BLOCKER] Sending a message does not work; escape the recipient list fixes the problem; r=mscott, a=granrose
git-svn-id: svn://10.0.0.236/trunk@51735 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 20:17:01 +00:00
brendan%mozilla.org
b3a1017637 - Chouck's changes to grow a JSIdArray if necessary in JS_Enumerate, with my
code review and fixes (r=chouck@geocast.com).  He needs this cuz he has no
  knowledge of exact number of properties before new-style enumerating them.
- Patch up jsdbgapi.c a bit -- it needs to use OBJ_GET_ATTRIBUTES and new APIs
  to do a better job describing properties to a debugger.
- Add JSMSG_CANT_DESCRIBE_PROPS for bogus non-native error case in jsdbgapi.c.
- Fix "Inappropriate" => "invalid" in JSMSG_BAD_ARRAY_LENGTH message.


git-svn-id: svn://10.0.0.236/trunk@51734 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:24:03 +00:00
wtc%netscape.com
50b0c89090 Bugzilla bug #17093: made plevent.c independent of any internal NSPR
headers (primpl.h in particular).  Tested on Linux, Solaris, Win32,
and Mac. r=srinivas@netscape.com
Modified files: lib/ds/Makefile, lib/ds/Makefile.in, lib/ds/plevent.c


git-svn-id: svn://10.0.0.236/trunk@51733 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:20:58 +00:00
rhp%netscape.com
b8a92b1146 Fix for composition quoting and cleanup for dogfood - Bug# 16703 16907 7518 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:04:56 +00:00
rhp%netscape.com
2624eb5719 Fix for attachments not visible and display crashers - Bug #: 16367 16786 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51731 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:02:39 +00:00
slamm%netscape.com
3ea969fa03 Need double quotes instead of single quotes to get variable values (fix bloat.pl).
git-svn-id: svn://10.0.0.236/trunk@51730 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 18:02:06 +00:00
norris%netscape.com
10dca74c3e Add contributors.
git-svn-id: svn://10.0.0.236/trunk@51729 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:52:48 +00:00
norris%netscape.com
32c0c98b21 Add license text.
git-svn-id: svn://10.0.0.236/trunk@51728 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:41:49 +00:00
norris%netscape.com
0034cf42f1 Add license boilerplate.
git-svn-id: svn://10.0.0.236/trunk@51727 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:36:20 +00:00
slamm%netscape.com
c6ce018a7f Need to 'require' treedata.pl to get warnings and bloat pattern strings.
git-svn-id: svn://10.0.0.236/trunk@51726 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:31:39 +00:00
norris%netscape.com
72dc3d0896 Should get ReferenceError exception for name not found.
git-svn-id: svn://10.0.0.236/trunk@51723 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 16:41:24 +00:00
norris%netscape.com
f8261501a4 Add contributors.
git-svn-id: svn://10.0.0.236/trunk@51722 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 16:40:30 +00:00
pavlov%netscape.com
36aeea55b5 don't install registry.rdf r=ramiro
git-svn-id: svn://10.0.0.236/trunk@51718 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:57:24 +00:00
pavlov%netscape.com
e70752a644 makefile changes for the Editor to editor.css change r=hyatt,ramiro
git-svn-id: svn://10.0.0.236/trunk@51717 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:56:35 +00:00
kin%netscape.com
d9ba7b42e8 Fix for bug #16701: Editor API Log playback of Insert HRule crashes in DOM code
and     bug #16848: DOM Crash
  - Removed extra NS_RELEASE(attrPrivate) call that was releasing
    attrPrivate one too many times, and causing nsDOMAttributeMap::SetNamedItem() to crash.
r=vidur@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51716 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:15:34 +00:00
morse%netscape.com
abe3c3c6c8 fixed typos, no code review
git-svn-id: svn://10.0.0.236/trunk@51715 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 13:13:48 +00:00
rods%netscape.com
8df8f94df3 added some more tests
git-svn-id: svn://10.0.0.236/trunk@51714 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 13:03:47 +00:00
duncan%be.com
5cabd411f1 Fix build under BeOS. r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51713 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 06:22:43 +00:00
nisheeth%netscape.com
341cd407a6 Macros for doing performance analysis of modules in Mozilla. This file is not part of the build yet.
git-svn-id: svn://10.0.0.236/trunk@51712 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 05:29:20 +00:00
varada%netscape.com
70051f68b3 clearing up some code
git-svn-id: svn://10.0.0.236/trunk@51711 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 05:14:12 +00:00
tbogard%aol.net
58ff9e6cc4 Added build directory to build a DLL for various docShells.
git-svn-id: svn://10.0.0.236/trunk@51710 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:53:13 +00:00
tbogard%aol.net
34c9d3fa3e Clarified some documentation.
git-svn-id: svn://10.0.0.236/trunk@51709 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:51:59 +00:00
tbogard%aol.net
4cab253cb0 Fixed a Caps problem.
git-svn-id: svn://10.0.0.236/trunk@51708 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:51:15 +00:00
tbogard%aol.net
14fc92dac1 Framed out the nsHTMLDocShell implementation. Setup to build a library.
git-svn-id: svn://10.0.0.236/trunk@51707 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:50:22 +00:00
tbogard%aol.net
671fe34afb Defined what nsCHTMLDocShell implements and included the appropriate header files.
git-svn-id: svn://10.0.0.236/trunk@51706 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:48:14 +00:00
karnaze%netscape.com
46cade08ac bug 5799 - considers percentage width of multiple cells when figuring width of auto table.
git-svn-id: svn://10.0.0.236/trunk@51705 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:34:28 +00:00
karnaze%netscape.com
18a5e00d6a new regression tests
git-svn-id: svn://10.0.0.236/trunk@51704 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:30:54 +00:00
tbogard%aol.net
9fa90714c2 Just added support for an NS_IMPL_ISUPPORTS 7 - 10.
git-svn-id: svn://10.0.0.236/trunk@51703 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 03:42:10 +00:00
varada%netscape.com
55871f81f5 fix for bug #17011 create copy (for config)invokes a window with text relevant to copy in it
git-svn-id: svn://10.0.0.236/trunk@51702 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 03:26:48 +00:00
gagan%netscape.com
e14999de24 Added profiling info for measuring performance when doing -all. Test case only.
git-svn-id: svn://10.0.0.236/trunk@51701 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 02:22:30 +00:00
varada%netscape.com
27f90cbea7 fix for bug 16977 - only edit fields showing up in the show summary button
git-svn-id: svn://10.0.0.236/trunk@51700 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 01:54:32 +00:00
dp%netscape.com
5871c388a1 bug# 15513 Removing dlldeps.cpp from RDF unix build. Patch from
waterson r=dp


git-svn-id: svn://10.0.0.236/trunk@51699 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 00:37:24 +00:00
sdagley%netscape.com
737d3b892e Pre-emptive fix for Mac (and possibly some ports) build bustage - if you're going to use a variable to contain a debug output file name it helps if the variable is declared on all platforms the code compiles for.
git-svn-id: svn://10.0.0.236/trunk@51698 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 00:29:15 +00:00
rickg%netscape.com
0aa148382a fixed FMM (in debug code); r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@51697 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 23:48:00 +00:00
mcafee%netscape.com
15b4b203b5 Adding XPCOM_MEM_BLOAT_LOG=1 for RunBloatTest.
git-svn-id: svn://10.0.0.236/trunk@51696 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:37:34 +00:00
gagan%netscape.com
bd175bcc62 Fixed bug 15963. Host: headers were not including port numbers. r=mozbot,a=self. (/msg mozbot do these diffs look ok to you? Should I continue with my checkin? <CR> mozbot: That is interesting. Please continue. )
git-svn-id: svn://10.0.0.236/trunk@51695 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:20:52 +00:00
warren%netscape.com
c9c3ab2262 Fixed up dll loading for Windows. It was silently failing.
git-svn-id: svn://10.0.0.236/trunk@51694 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:01:09 +00:00
dp%netscape.com
ccb30ad195 bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing
operating on refcnt directly. r=troy r=dp


git-svn-id: svn://10.0.0.236/trunk@51693 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:19:42 +00:00
tonyr%fbdesigns.com
c9b397be49 Updated address book cls id names that changed
git-svn-id: svn://10.0.0.236/trunk@51692 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:09:21 +00:00
rods%netscape.com
5926a49df7 added more tests
git-svn-id: svn://10.0.0.236/trunk@51691 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:04:17 +00:00
rods%netscape.com
a16142db50 updated test
git-svn-id: svn://10.0.0.236/trunk@51690 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 15:07:41 +00:00
rods%netscape.com
26d3fe5556 added file
git-svn-id: svn://10.0.0.236/trunk@51689 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 15:07:25 +00:00
rods%netscape.com
6579bbdd80 added more tests
git-svn-id: svn://10.0.0.236/trunk@51688 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 14:05:44 +00:00
ramiro%fateware.com
b15a17bfcb Simplify the package list file.
git-svn-id: svn://10.0.0.236/trunk@51687 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 13:44:34 +00:00
pavlov%netscape.com
185c67ee12 remove registry.rdf r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51686 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:57:49 +00:00
pavlov%netscape.com
f346c3e821 fix build problems on linux r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51685 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:20:49 +00:00
warren%netscape.com
b9ca6db5fa Fixed logic for XPCOM_MEM_LOG_CLASSES case.
git-svn-id: svn://10.0.0.236/trunk@51684 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:13:52 +00:00
hyatt%netscape.com
68f0c59d3a chrome registry can now be dynamically built from RDF fragments t=pavlov
git-svn-id: svn://10.0.0.236/trunk@51683 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:00:41 +00:00
hyatt%netscape.com
e3d0859994 making chrome registry not be a single uber datasource anymore r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51682 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:27:12 +00:00
rpotts%netscape.com
c275b7fca5 Backing out the fix for bug #15560. This fixes the editor regression - bug #16937
git-svn-id: svn://10.0.0.236/trunk@51681 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:26:54 +00:00
pavlov%netscape.com
697deffc1d rename PrefsWindow.xul so that it can be better friends with the chrome registry r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51679 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:16:45 +00:00
pavlov%netscape.com
35c3e18a5e rename to be happy with the chrome registry r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51678 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:07:04 +00:00
pavlov%netscape.com
17d1767696 renaming file to be consistant with chrome registry
git-svn-id: svn://10.0.0.236/trunk@51677 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:00:53 +00:00
hyatt%netscape.com
f44eb6e877 make registry work without needing an rdf datasource r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51676 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 06:59:30 +00:00
hyatt%netscape.com
dd85258734 renaming skin.css to global.css r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51675 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 06:58:38 +00:00
dp%netscape.com
5f7aa39be5 bug#16742 Fixing delete on nsISupports. Thanks for patch from <heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing operating on refcnt directly. r=dp
git-svn-id: svn://10.0.0.236/trunk@51674 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 04:41:17 +00:00
beard%netscape.com
b500a68477 changed GC_abort() to call ExitToShell() rather than abort(). bug=15906
git-svn-id: svn://10.0.0.236/trunk@51673 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 03:26:10 +00:00
rods%netscape.com
d0c68ca52f Simple changed from COLOR_DESKTOP to COLOR_APPWORKSPACE for appworkspace enum
for css 2 color setting
fixes bug 16853,r=none


git-svn-id: svn://10.0.0.236/trunk@51672 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 03:03:38 +00:00
beard%netscape.com
964164ffe9 removed obsolete access paths. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51671 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:45:17 +00:00
varada%netscape.com
676eaa791f fix to bug #16981 changed Text field to editbox so that value can be enterred
git-svn-id: svn://10.0.0.236/trunk@51670 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:23:44 +00:00
varada%netscape.com
de47ad8dca fix to bug#16973 - nci file editor field is made dynamic text - can be changed only using file browsing
git-svn-id: svn://10.0.0.236/trunk@51669 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:18:17 +00:00
varada%netscape.com
66774f2d49 fix for bug #7850 - have to call function depend on the Next button on the ini file
git-svn-id: svn://10.0.0.236/trunk@51668 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:04:37 +00:00
ssu%netscape.com
2aa8ec93a3 fixes bugs #15394, #15603, part of #15644, and #15487. r=sgehani. The
xpinstall fileops functions have been updated to perform error detection
as much as it can prior to executing the command.


git-svn-id: svn://10.0.0.236/trunk@51667 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 01:07:45 +00:00
mscott%netscape.com
684b3cc1bb Bug #16927 add GetMessageUrlFromUri to nsIMsgMessageService
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51666 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:39:57 +00:00
mscott%netscape.com
0b058cd771 Bug #16927 implement GetMessageUrlFromUri
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51665 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:39:28 +00:00
troy%netscape.com
d79892b99d Changed nsTextFrame to be derived from nsFrame instead of nsSplittableFrame.
nsTextFrame now has only a next-in-flow pointer and no prev-in-flow pointer.
Subclass nsContinuingTextFrame is used for continuing text frames; it has a
prev-in-flow pointer. This saves 4 bytes


git-svn-id: svn://10.0.0.236/trunk@51664 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:19:14 +00:00
troy%netscape.com
5859acba05 Space reductions for nsTableRowFrame. Changed mInitializedChildren to be a
frame state bit, and changed mMinRowSpan and mRowIndex to be packed into
one 32-bit field. Total savings of 8 bytes per row frame


git-svn-id: svn://10.0.0.236/trunk@51663 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:08:30 +00:00
dp%netscape.com
1e5c5df64f bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> r=dp


git-svn-id: svn://10.0.0.236/trunk@51662 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:34:55 +00:00
dp%netscape.com
b534e205fe bug#16742 Fixing delete on nsISupports. Thanks for patch from <heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing operating on refcnt directly. r=dp
git-svn-id: svn://10.0.0.236/trunk@51661 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:33:29 +00:00
duncan%be.com
5ebdcee645 Make profile manager build under BeOS.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51660 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:13:55 +00:00
beard%netscape.com
8678f1bdd7 never consider code offsets greater than the offset of the instruction, which ensures that the returned file offset is always correct. bug=15906
git-svn-id: svn://10.0.0.236/trunk@51659 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 15:57:31 +00:00
tbogard%aol.net
ac565dc536 Framed out nsWebBrowser implementation. Basically just added all the interface functions. Code now has a place to live.
git-svn-id: svn://10.0.0.236/trunk@51658 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:56:27 +00:00
tbogard%aol.net
92612afa70 Added some includes of the interfaces that make up nsCWebBrowser
git-svn-id: svn://10.0.0.236/trunk@51657 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:55:39 +00:00
tbogard%aol.net
e9e6e9c241 Just changed some comments and function ordering.
git-svn-id: svn://10.0.0.236/trunk@51656 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:51:45 +00:00
jband%netscape.com
d7cf1d350b r=mccabe
Primarily fixes to properly handle nsIXPCSecurityManager vetos of
xpconnect activities.

- The code was not propagating security manager vetos of native wrapping up
through xpconnect internals. So, xpconnect was erroneously masking the
security exception with its own 'failed to convert param' exception.
This effects the signatures of nsXPCWrappedNative::GetNewOrUsedWrapper
and nsXPCWrappedJSClass::GetNewOrUsedClass.

- This propagation also helps with the problem that sometimes interfaces
are not set as [scriptable] and we did not make that clear as the source
of xpconnect's failure to convert a param in calling a method. Now this
specific class of exceptions is indicated in the JS exception object when
this happens.

- Added an explicit call to js_ForceGC on shutdown of xpcshell to aid in
avoiding 'false positives' in leak detection

- Return JS_FALSE rather than JS_TRUE when an exception is thrown in
xpcjsid to make the jsengine notices the exception.

- Move #includes that others added in xpcmodule.cpp to xpcprivate.h in
order to maintain the include conventions of this module.

- Avoid throwing an exception if it represents a security manager veto
and the security manager set an exception already.

- Replace uses of nsCOMTypeInfo<> added by scc with NS_GET_IID macros.

- Fixed a methodname misspelling because reviewers care about stuff
like that :)


git-svn-id: svn://10.0.0.236/trunk@51655 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:20:04 +00:00
tbogard%aol.net
398c14c4d0 Just added support for an NS_IMPL_ISUPPORTS6.
git-svn-id: svn://10.0.0.236/trunk@51654 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 06:55:45 +00:00
dp%netscape.com
40ee849701 bug# 16742 Fixing delete on nsISupports Thanks for patch from <heikki@citec.fi>. r=dp
git-svn-id: svn://10.0.0.236/trunk@51639 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 06:15:31 +00:00
dp%netscape.com
cc26158c98 bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing
operating on refcnt directly. r=dp


git-svn-id: svn://10.0.0.236/trunk@51638 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 05:45:41 +00:00
dp%netscape.com
259487cdf7 bug#16762 Removing delete on a nsISupports. Thanks to
<heikki@citec.fi> Plus changes to use DECL_ and IMPL_ macros and not
hand define mrefcnt. r=dp


git-svn-id: svn://10.0.0.236/trunk@51637 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 05:31:46 +00:00
ducarroz%netscape.com
6a5732fdec Bug 14258, implement Send Page, R=alecf
git-svn-id: svn://10.0.0.236/trunk@51636 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:51:40 +00:00
dougt%netscape.com
9544338359 Modification based on design review.
(THIS IS NOT PART OF THE BUILD YET)


git-svn-id: svn://10.0.0.236/trunk@51635 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:51:35 +00:00
ducarroz%netscape.com
798afa71eb Bug 14258, implement Send Page. R=alecf
git-svn-id: svn://10.0.0.236/trunk@51634 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:50:20 +00:00
varada%netscape.com
35cf097c8a fix for bug #10806
git-svn-id: svn://10.0.0.236/trunk@51633 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:41:41 +00:00
varada%netscape.com
fd98dc9090 fix for bug #5987
git-svn-id: svn://10.0.0.236/trunk@51632 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:30:43 +00:00
warren%netscape.com
95063f0074 Fixed warnings.
git-svn-id: svn://10.0.0.236/trunk@51631 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:27 +00:00
warren%netscape.com
dc65f370b6 Extended docs to talk about new env vars, and how to read bloat logs.
git-svn-id: svn://10.0.0.236/trunk@51630 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:23 +00:00
warren%netscape.com
c8d6aed234 Cleaned up nsTraceRefcnt environment variables. r=kipp,beard
git-svn-id: svn://10.0.0.236/trunk@51629 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:19 +00:00
troy%netscape.com
c16f001bc8 Changed Run() to give priority to system messages when pumping
messsages. These are the same changes that I made to viewer's message
pump on 9/13/99


git-svn-id: svn://10.0.0.236/trunk@51628 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:09:30 +00:00
rickg%netscape.com
a553c7ea86 fixed infinite-loop bug 17045 by conditioning control loop. r=buster
git-svn-id: svn://10.0.0.236/trunk@51627 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:06:19 +00:00
troy%netscape.com
feca3d387f Changed Clear() to check for a shared node arena
git-svn-id: svn://10.0.0.236/trunk@51626 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:04:21 +00:00
troy%netscape.com
3972c8f69a Removed a comment
git-svn-id: svn://10.0.0.236/trunk@51624 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 02:27:07 +00:00
nisheeth%netscape.com
b6ce91bcb5 r=troy. Siblings of frames get traversed iteratively during capturing/restoring of state. Earlier they were traversed recursively which was causing the call stack to grow too large.
git-svn-id: svn://10.0.0.236/trunk@51623 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:43:49 +00:00
slamm%netscape.com
7c904e3aa8 Add bloat processing. Cleanup tacky code.
git-svn-id: svn://10.0.0.236/trunk@51622 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:43:28 +00:00
slamm%netscape.com
1cd3dc4f49 Take out debug statement.
git-svn-id: svn://10.0.0.236/trunk@51621 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:35:40 +00:00
beard%netscape.com
4d41f52154 added line hiliting in -blame mode.
git-svn-id: svn://10.0.0.236/trunk@51619 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:33:42 +00:00
sspitzer%netscape.com
cfadbaffa1 remove pref-select.html, it is obsolete.
git-svn-id: svn://10.0.0.236/trunk@51616 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:29:09 +00:00
sspitzer%netscape.com
992247191f remove PrefsWindow.html, it is obsolete.
git-svn-id: svn://10.0.0.236/trunk@51615 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:26:07 +00:00
slamm%netscape.com
e95f03bd55 Parse build logs for bloat data from warren@netscape.com's bloat tool.
git-svn-id: svn://10.0.0.236/trunk@51614 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:22:41 +00:00
selmer%netscape.com
2cee86d35e Include IB into the wizard
git-svn-id: svn://10.0.0.236/trunk@51613 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:21:09 +00:00
slamm%netscape.com
4d6f026b73 Load bloat data. Clean up load_who().
git-svn-id: svn://10.0.0.236/trunk@51612 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:18:25 +00:00
slamm%netscape.com
5b100726d8 Add bloat data to tree cells that have it.
git-svn-id: svn://10.0.0.236/trunk@51611 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:18:04 +00:00
pavlov%netscape.com
da0e9ca233 add ScrollRect method to nsIWidget -- implimented on linux and stubbed in nsBaseWidget for mac and windows. Added ifdef'd scrolling code that makes scrolling really fast on linux. Updated nsIWidget.idl (not built) to merge some changes from a branch and added ScrollRect. Added ifdefs for using gtk_fixed instead of gtk_layout as part of the new scrolling code.
git-svn-id: svn://10.0.0.236/trunk@51610 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:17:20 +00:00
bienvenu%netscape.com
b9244d6491 cleanup dbs at shutdown, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51609 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:13:10 +00:00
morse%netscape.com
6045d43774 fix bug 16753, memory leak, r=rjc
git-svn-id: svn://10.0.0.236/trunk@51608 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:01:58 +00:00
gagan%netscape.com
e5e1218aae Post requests are now only read upto the specified amount. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51607 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:47:24 +00:00
varada%netscape.com
91451df7a3 fixes to bug#14014
git-svn-id: svn://10.0.0.236/trunk@51606 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:38:51 +00:00
varada%netscape.com
5ea1cd0e4c fixes to bug #2794
git-svn-id: svn://10.0.0.236/trunk@51605 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:38:06 +00:00
beard%netscape.com
d7abad5a6c fixing breakage by #undef BlockAllocCat
git-svn-id: svn://10.0.0.236/trunk@51604 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:21:17 +00:00
ramiro%fateware.com
0816082384 Add lots of comments. Deal with %dir. Deal with duplicate entries.
Properly call regxpcom each time components get installed.
Not part of SeaMonkey.


git-svn-id: svn://10.0.0.236/trunk@51603 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:15:23 +00:00
selmer%netscape.com
17b7d985c2 Fixups to makefile system for globals dll
git-svn-id: svn://10.0.0.236/trunk@51602 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:12:13 +00:00
selmer%netscape.com
a1f6f3c1a3 Feeble first DLL for IB
git-svn-id: svn://10.0.0.236/trunk@51601 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:10:24 +00:00
pnunn%netscape.com
efe6dfa795 fix for mac bustage. pnunn.
git-svn-id: svn://10.0.0.236/trunk@51600 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:10:14 +00:00
selmer%netscape.com
52de2be8a7 adding globals
git-svn-id: svn://10.0.0.236/trunk@51598 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:46:35 +00:00
selmer%netscape.com
36e4eb89ff globalizing includes
git-svn-id: svn://10.0.0.236/trunk@51597 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:45:20 +00:00
dmose%mozilla.org
d924535fa1 cmd/winfe lives on in the MozillaClassic branch only. removing from the trunk. a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@51596 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:44:52 +00:00
selmer%netscape.com
5b578df427 globals into a dll
git-svn-id: svn://10.0.0.236/trunk@51595 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:42:02 +00:00
sspitzer%netscape.com
1668a389f4 make the xul look pretty by using html fieldsets and legends.
git-svn-id: svn://10.0.0.236/trunk@51593 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:31:05 +00:00
ramiro%fateware.com
295053baa2 Dont put the static rdfutil thing inside the FORCE_ALL block. r=alecf.
git-svn-id: svn://10.0.0.236/trunk@51592 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:28:30 +00:00
selmer%netscape.com
00ffb48018 Globals implementation
git-svn-id: svn://10.0.0.236/trunk@51591 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:28:27 +00:00
sspitzer%netscape.com
54b8cc865e changes for correctness and to make the pref ui look better.
git-svn-id: svn://10.0.0.236/trunk@51590 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:27:43 +00:00
sspitzer%netscape.com
aaff3bbf7e make the xul look pretty by using html fieldsets and legends.
fix #17078:  fix the xul so that pref-messages.xul stops asserting like mad or crashing.


git-svn-id: svn://10.0.0.236/trunk@51589 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:25:18 +00:00
sspitzer%netscape.com
17aab81855 make the xul look pretty by using html fieldsets and legends.
git-svn-id: svn://10.0.0.236/trunk@51588 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:22:52 +00:00
endico%mozilla.org
bb01bac34c improve error message mailed when cvs update dies
git-svn-id: svn://10.0.0.236/trunk@51587 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:07:44 +00:00
beard%netscape.com
f0acfa932d #include "xp_mcom.h" to fix link breakage.
git-svn-id: svn://10.0.0.236/trunk@51586 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:58:28 +00:00
radha%netscape.com
3139e13324 Turning off debug flag that got set in my previous checkin
git-svn-id: svn://10.0.0.236/trunk@51585 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:58:16 +00:00
beard%netscape.com
fb7e21676d MLK: Fixed implementations of QueryInterface, AddRef, and Release to perform correct reference counting. bug=15380, r=evaughan
git-svn-id: svn://10.0.0.236/trunk@51584 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:50:01 +00:00
pnunn%netscape.com
0ac69a866f To fix mac bustage. pnunn.
git-svn-id: svn://10.0.0.236/trunk@51583 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:48:04 +00:00
beard%netscape.com
2a64a10c92 synched.
git-svn-id: svn://10.0.0.236/trunk@51582 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:39:51 +00:00
beard%netscape.com
5d5cc2a548 changed SharedGlobal.java to Global.java
git-svn-id: svn://10.0.0.236/trunk@51581 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:39:23 +00:00
norris%netscape.com
986ea91e68 Changes for improved errors-as-exceptions handling.
git-svn-id: svn://10.0.0.236/trunk@51578 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:02:58 +00:00
norris%netscape.com
92ab48d1d8 Use simpler, more widely applicable structure for global. Also avoids test failure for Function called as a function.
git-svn-id: svn://10.0.0.236/trunk@51577 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:00:21 +00:00
endico%mozilla.org
9b64c7df39 cvs error notification was busted
git-svn-id: svn://10.0.0.236/trunk@51576 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:59:10 +00:00
norris%netscape.com
a59a557d7d A NativeString object shouldn't be unwrapped to a primitive.
git-svn-id: svn://10.0.0.236/trunk@51575 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:58:54 +00:00
pnunn%netscape.com
4791c61ec9 bug#16785: forgot to checkin the include file change. Removing old, obsolete get image type call.
pnunn.


git-svn-id: svn://10.0.0.236/trunk@51574 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:46:56 +00:00
danm%netscape.com
abe94c118b set window title using multibyte. submitted by jamestoder@yahoo.com. r:ftang@netscape.com, by lack of timely objection.
git-svn-id: svn://10.0.0.236/trunk@51573 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:45:19 +00:00
sspitzer%netscape.com
35c39da3d2 fix typo. #17087.
"I think about the education that I missed.  but then my homework was never quite like this.  Got it bad, got it bad, got it bad..."


git-svn-id: svn://10.0.0.236/trunk@51572 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:41:13 +00:00
danm%netscape.com
0750508062 making GetACPString parameter const. part of submission from jamestoder@yahoo.com. r:me
git-svn-id: svn://10.0.0.236/trunk@51571 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:41:04 +00:00
akkana%netscape.com
e9db800eb8 Update a few of the standalone tests. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@51570 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:35:16 +00:00
gagan%netscape.com
78b44f58d8 a dummy post request file for testing post requests in HTTP. not in the build.
git-svn-id: svn://10.0.0.236/trunk@51569 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:27:38 +00:00
gagan%netscape.com
6955bb58c9 Added /post test as well. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51568 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:24:57 +00:00
gagan%netscape.com
ce76e5ae7d Added stuff to the test server to handle post requests as well. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51567 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:21:30 +00:00
ftang%netscape.com
59e649828f fix locale mapping for CLE. r=ftang
git-svn-id: svn://10.0.0.236/trunk@51566 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:11:50 +00:00
bienvenu%netscape.com
0ef6e9d38d one more news leak fix r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51565 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:11:17 +00:00
alecf%netscape.com
31378ed4eb update status
git-svn-id: svn://10.0.0.236/trunk@51564 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:59 +00:00
pnunn%netscape.com
c4d7a55705 bug#16785. r:neeti@netscape.com. Clean up after changing mime handling in imglib.
git-svn-id: svn://10.0.0.236/trunk@51563 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:28 +00:00
alecf%netscape.com
ba7f0a4cb5 prefwindow is now a service thanks to nsIModule conversion
git-svn-id: svn://10.0.0.236/trunk@51562 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:26 +00:00
srinivas%netscape.com
2068a5408d OpenVMS updates by colin@theblakes.com
git-svn-id: svn://10.0.0.236/trunk@51561 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:08 +00:00
alecf%netscape.com
450ceda4e0 convert nsPrefWindow to a module
prefwindow was doing it's own singleton management, so changed it to use getService()


git-svn-id: svn://10.0.0.236/trunk@51560 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:05:31 +00:00
bienvenu%netscape.com
16ace9def7 one more addrbook memory leak fix r=mscott
git-svn-id: svn://10.0.0.236/trunk@51559 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:04:45 +00:00
pnunn%netscape.com
42f2519c84 bug#15585. r:neeti@netscape.com. Fix build warnings.
git-svn-id: svn://10.0.0.236/trunk@51558 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:04:28 +00:00
pnunn%netscape.com
4be52ad659 Bug#13505: r:neeti@netscape.com. Replace str()'s with nsCRT()'s & nspr()'s.
git-svn-id: svn://10.0.0.236/trunk@51556 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:03:52 +00:00
akkana%netscape.com
10a4fb8f22 16988: filter out BR type=_moz, which the editor inserts. r=syd
git-svn-id: svn://10.0.0.236/trunk@51555 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:03:29 +00:00
scc%netscape.com
866732108c File Removed.
git-svn-id: svn://10.0.0.236/trunk@51554 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:02:15 +00:00
srinivas%netscape.com
bf8979df4c PR_SetThreadPriority should set the priority unconditionally.
git-svn-id: svn://10.0.0.236/trunk@51553 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:01:51 +00:00
racham%netscape.com
3f91090fc5 r=sspitzer. Fix for bug 16209. This checkin fixes mozregistry entries to avoid crashes from M9 or builds prior to that
git-svn-id: svn://10.0.0.236/trunk@51552 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:00:53 +00:00
jefft%netscape.com
8f8c3afe28 fixed bug 11892 - [dogfood] When Name or Address of a recipient includes 8-bit characters address is incorrectly formed; not quoting name part of an email address; calling GetPath() instead of GetFileName() for all recipients; r=rhp, mscott
git-svn-id: svn://10.0.0.236/trunk@51551 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:00:07 +00:00
srinivas%netscape.com
d303858686 Fixed typo in debug statement.
git-svn-id: svn://10.0.0.236/trunk@51550 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:59:34 +00:00
srinivas%netscape.com
fe52fa5602 Defined _MD_PIPEAVAILABLE; checkin for "Duncan Wilcox" <duncan@be.com>.
git-svn-id: svn://10.0.0.236/trunk@51549 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:58:00 +00:00
srinivas%netscape.com
46e9b52597 Map the SO_BROADCAST option to invalid option, when not supported by the
system.


git-svn-id: svn://10.0.0.236/trunk@51548 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:56:25 +00:00
jband%netscape.com
d8c9cc6cae commiting patch from Duncan Wilcox <duncan@be.com> to get prototype right in prep for inline assembly call - some pick compilers didn't like unsigned int when it was really uint32. r=jband
git-svn-id: svn://10.0.0.236/trunk@51547 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:53:05 +00:00
jefft%netscape.com
5dd4804e4c fixed bug 17069 - Save As...File format list for saving a selected message shows a .hml for the HTML format; fix typo; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@51546 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:52:56 +00:00
srinivas%netscape.com
1a74d3549b Add PR_SendFile to the PRIOMethods tables to enable use in layered FDs.
Bugzilla #17012.


git-svn-id: svn://10.0.0.236/trunk@51545 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:49:19 +00:00
radha%netscape.com
a285ab741e Clean up of Session History apis. Corresponding changes to the users of SH. r=mcafee. No bug #.
git-svn-id: svn://10.0.0.236/trunk@51544 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:48:07 +00:00
ducarroz%netscape.com
b21e040071 Fix for bug 15201. We need to convert back the result from UTF-8 to Unicode. R=mscott, bienvenu
git-svn-id: svn://10.0.0.236/trunk@51543 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:37:42 +00:00
bienvenu%netscape.com
8ce16092ef fix leaks in news/nntp r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51542 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:33:04 +00:00
bienvenu%netscape.com
598ff07fea fix memory leaks in vcard and calendar factories r=rhp
git-svn-id: svn://10.0.0.236/trunk@51541 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:32:02 +00:00
mcafee%netscape.com
0f2352836a Fixing some mis-use error cases, adding comments. Added --testonly flag. code=slamm, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51540 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:31:56 +00:00
slamm%netscape.com
085f841b9d Fix typo.
git-svn-id: svn://10.0.0.236/trunk@51539 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 19:16:40 +00:00
slamm%netscape.com
cb3e8e41cc Add some comments. Describe data structures. Tidy up a bit.
git-svn-id: svn://10.0.0.236/trunk@51538 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 18:53:56 +00:00
norris%netscape.com
ee5e7e9f37 Shouldn't test for equality against the message string, which is implementation independent.
git-svn-id: svn://10.0.0.236/trunk@51537 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 18:33:46 +00:00
slamm%netscape.com
5c43a70394 Add filter for long long constants. Make sure summary table includes everyone (fix off by one error).
git-svn-id: svn://10.0.0.236/trunk@51536 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 17:34:16 +00:00
norris%netscape.com
484a8455bd Don't print out control characters that break the driver.
git-svn-id: svn://10.0.0.236/trunk@51535 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 17:31:59 +00:00
norris%netscape.com
38e1413a00 Fix formatting.
git-svn-id: svn://10.0.0.236/trunk@51534 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 16:58:30 +00:00
norris%netscape.com
e763168909 Fix javadoc
git-svn-id: svn://10.0.0.236/trunk@51533 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 16:56:56 +00:00
jmas%softcatala.org
85ccdaf936 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51532 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 15:53:29 +00:00
troy%netscape.com
d16381b6f3 Removed 5 convenience functions from nsIFrame
git-svn-id: svn://10.0.0.236/trunk@51531 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 14:53:52 +00:00
kipp%netscape.com
2ed3a3fc6a Removed some more warnings
git-svn-id: svn://10.0.0.236/trunk@51530 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 14:51:41 +00:00
dcone%netscape.com
fd397214fb Fixed warning.
git-svn-id: svn://10.0.0.236/trunk@51529 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:29:06 +00:00
srinivas%netscape.com
be42687878 PL_ProcessPendingEvents() dispatches only those events currently on the
queue. Added a static helper function (_pl_GetEventCount) that locks the
monitor and counts the number of events in the queue. Checkin for troy.


git-svn-id: svn://10.0.0.236/trunk@51528 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:28:39 +00:00
dcone%netscape.com
d23e143664 Fixed the rounding on some transform math. r=kmkclusky
git-svn-id: svn://10.0.0.236/trunk@51527 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:28:22 +00:00
rods%netscape.com
285da5c5be adding test cases for form controls
git-svn-id: svn://10.0.0.236/trunk@51526 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 12:46:13 +00:00
braddr%puremagic.com
2e3aacd5dd Change NS_COMFALSE to NS_ERROR_INVALID_ARG. Every caller of LookupName
tests explicitly for NS_OK currently.
r=sleestack


git-svn-id: svn://10.0.0.236/trunk@51525 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 08:03:15 +00:00
briano%netscape.com
3e0f0a58b5 Automated update
git-svn-id: svn://10.0.0.236/trunk@51524 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 07:15:11 +00:00
ramiro%fateware.com
a5d3f6cc70 Removing the badly rotten MOZ_STRIP_NOT_EXPORTED hack. We now have a better
way to accomplish the same thing using linker version scripts.
r=cls@seawood.org


git-svn-id: svn://10.0.0.236/trunk@51521 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 07:11:43 +00:00
braddr%puremagic.com
5d7d8cded2 Change NS_COMFALSE to NS_ERROR_ABORT throughout the space manager.
r=smfr for these two files, and r=scc for the previous file


git-svn-id: svn://10.0.0.236/trunk@51520 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 06:49:50 +00:00
dp%netscape.com
7162f4cdbb bug# 9221 Fixing autoreg terminating on bad aliases. We now let it go
as far as possible ignoring errors. r=sfraser


git-svn-id: svn://10.0.0.236/trunk@51519 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 06:32:26 +00:00
rpotts%netscape.com
c6e185762b Fix build bustage on platforms that require full infor for nsCOMPtrs...
git-svn-id: svn://10.0.0.236/trunk@51518 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:56:19 +00:00
ramiro%fateware.com
4b4d193abc More rpm work in progress. Work around some bugs in rules.mk.
git-svn-id: svn://10.0.0.236/trunk@51517 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:55:29 +00:00
braddr%puremagic.com
ef38d2fd9c Change NS_COMFALSE instances to NS_ERROR_ABORT's
git-svn-id: svn://10.0.0.236/trunk@51516 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:32:31 +00:00
wtc%netscape.com
e83d506ed5 Removed temporary depend:clean hack.
git-svn-id: svn://10.0.0.236/trunk@51515 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:29:48 +00:00
rpotts%netscape.com
99e00aec99 bug #13054 (r=warren,gagan). Reworked the way requests are sent to the server. Now requests can be of an arbitrary size...
git-svn-id: svn://10.0.0.236/trunk@51514 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:13:01 +00:00
ramiro%fateware.com
dbec4b872f Link in raptorgfx dynamically to make the component properly loadable.
regxpcom was breaking on this one.  r=valeski


git-svn-id: svn://10.0.0.236/trunk@51513 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:06:39 +00:00
valeski%netscape.com
aedd1c1253 fixing build warning
git-svn-id: svn://10.0.0.236/trunk@51512 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:56:24 +00:00
valeski%netscape.com
3f594fbcb6 fixing build warning
git-svn-id: svn://10.0.0.236/trunk@51511 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:48:31 +00:00
dp%netscape.com
7da3eadc15 beautify...
git-svn-id: svn://10.0.0.236/trunk@51510 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:47:14 +00:00
valeski%netscape.com
5310cb0ddc removing last reference to nsFtpStreamListenerEvent.h. Actually it was a commented out line.
git-svn-id: svn://10.0.0.236/trunk@51508 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:33:19 +00:00
valeski%netscape.com
3d07f98f12 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51507 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:32:18 +00:00
sfraser%netscape.com
f90deff3a6 Fixing Mac FTP projects for valeski
git-svn-id: svn://10.0.0.236/trunk@51506 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:24:08 +00:00
valeski%netscape.com
5f29d72129 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51505 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:22:54 +00:00
valeski%netscape.com
d1271b7aa4 adding connection cache interface
git-svn-id: svn://10.0.0.236/trunk@51504 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:11:12 +00:00
valeski%netscape.com
455aa3e358 14659, r=dougt. FTP now uses xpcom proxies to send stream listener notifications back to the channel thread. it also uses them to access connections from the protocol handler cache.
git-svn-id: svn://10.0.0.236/trunk@51503 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:10:46 +00:00
valeski%netscape.com
77339b5eec 17039, r=dougt. Releasing QI'd proxy object was causing a crash. this is a temp work around.
git-svn-id: svn://10.0.0.236/trunk@51502 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:07:53 +00:00
troy%netscape.com
3a327d90e7 Fixed compiler warning about unused variable
git-svn-id: svn://10.0.0.236/trunk@51501 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:01:23 +00:00
rods%netscape.com
f690c63c37 Changed the parameter of the CalcNavQuirksSize to take the input spec instead of the length
not it properly calculates the number of cols and rows when in NavQuiks mode
r=kmcclusk, part of bug 7461


git-svn-id: svn://10.0.0.236/trunk@51498 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 03:14:03 +00:00
ramiro%fateware.com
21e92e4270 Made the spec file actually work. Not part of SeaMonkey.
git-svn-id: svn://10.0.0.236/trunk@51497 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:55:21 +00:00
ramiro%fateware.com
36b1b32126 Fixed the mozilla script. Not part of anything.
git-svn-id: svn://10.0.0.236/trunk@51496 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:54:23 +00:00
kipp%netscape.com
1a6f5307c4 r=pavlov; fixed up prioritization of the plevent queue so that it's lower than the normal priority; this fixes UI starvation on long document loads AND lets timers through so that painting works (bugs 7455, 6048, etc.)
git-svn-id: svn://10.0.0.236/trunk@51495 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:47:02 +00:00
tbogard%aol.net
e68aa79d1d Added building of the DLL.
git-svn-id: svn://10.0.0.236/trunk@51494 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:36:35 +00:00
tbogard%aol.net
1709ffcde6 Framed out nsWebBrowser. Added nsCWebBrowser definition. Setup to build library.
git-svn-id: svn://10.0.0.236/trunk@51493 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:35:18 +00:00
tbogard%aol.net
e598aadeba Fixed some syntax errors.
git-svn-id: svn://10.0.0.236/trunk@51492 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:32:28 +00:00
tbogard%aol.net
b577f2a1bc Framed out nsWebBrowserSetup. Added nsCWebBrowserSetup specification. Setup building of the library.
git-svn-id: svn://10.0.0.236/trunk@51491 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:30:51 +00:00
tbogard%aol.net
6408004f20 Fixed the naming.... Added some comments.
git-svn-id: svn://10.0.0.236/trunk@51490 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:29:29 +00:00
tbogard%aol.net
ee49ae552f Added nsCHTMLDocShell.
git-svn-id: svn://10.0.0.236/trunk@51489 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:27:42 +00:00
tbogard%aol.net
3dc8aba7a4 Added a C++ include of nsIPresContext.h
git-svn-id: svn://10.0.0.236/trunk@51488 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:26:35 +00:00
sspitzer%netscape.com
6eb15ceb38 add pref-mailnews.js, which has the necessary (but currently not working) JS for the color picker.
rewrite the xul so that the html select heeds the quote prefs.  (#15230)

use a color picker instead of an empty html select.


git-svn-id: svn://10.0.0.236/trunk@51487 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:10:49 +00:00
sspitzer%netscape.com
0cfb0a45bd make the PrefWindow work for html select dom elements, instead of just html input dom elements.
right now, it only works for int prefs.  fix #15230, heed and reflect the quoted style and quoted size prefs
in the html select widget in pref-mailnews.xul.

rewrite the html select elements in the pref xul, to work correctly.
remove unused, commented out xul to avoid confusion.

add new option for "yesterday" for the news offline download pref.
use nsCOMPtr. use PR_snprintf() to avoid potential buffer overruns.
use #defines to clean up the code.  use PR_sscanf instead of sscanf.

r=mscott


git-svn-id: svn://10.0.0.236/trunk@51486 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:09:18 +00:00
troy%netscape.com
54572af2e6 r=karnaze@netscape.com
Save 8 bytes per table cell frame by eliminating mCollapseOffset and
using a frame property instead.


git-svn-id: svn://10.0.0.236/trunk@51485 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:06:22 +00:00
bienvenu%netscape.com
de04e9ade9 always update folders when clicking on them r=putterman
git-svn-id: svn://10.0.0.236/trunk@51484 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:59:50 +00:00
amusil%netscape.com
d522c5e798 Changed FALSE to XP PR_FALSE
git-svn-id: svn://10.0.0.236/trunk@51483 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:54:36 +00:00
brendan%mozilla.org
9ef594d4bf Avoid gratuitous initialization and extra sets of ok (r=shaver@mozilla.org).
git-svn-id: svn://10.0.0.236/trunk@51482 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:44:47 +00:00
scc%netscape.com
ef634d5f6b remove nsIVariant.h and nsVariant.cpp as per bug #16987 and changes already in for Unix (thanks brad) and Mac, r=danm
git-svn-id: svn://10.0.0.236/trunk@51481 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:33:03 +00:00
endico%mozilla.org
49ce32b0ec oops forgot to add the newsbot directory to the path "../newsbot/newsbot.html",
git-svn-id: svn://10.0.0.236/trunk@51480 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:32:59 +00:00
alecf%netscape.com
11dd83ae66 update status
git-svn-id: svn://10.0.0.236/trunk@51479 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:27:08 +00:00
slamm%netscape.com
242640cfa1 Get the relative prefix for the static page correct.
git-svn-id: svn://10.0.0.236/trunk@51478 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:23:48 +00:00
amusil%netscape.com
547d0559fa Address book fix. DB file now gets closed in the destructor. Reviewed by bienvenu.
git-svn-id: svn://10.0.0.236/trunk@51477 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:18:42 +00:00
wtc%netscape.com
89df62c930 Bugsplat bug #366500: use the default, PRLock-based atomic stack
implementation on OSF1. r=larryh,srinivas@netscape.com.
Modified files: _osf1.h, osf1.c.


git-svn-id: svn://10.0.0.236/trunk@51476 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:10:00 +00:00
alecf%netscape.com
ab99f0ec36 nsIModulize mime emitters - porkjockey work, r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51475 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:05:04 +00:00
dp%netscape.com
f7af54f40f bug# 15046 Preventing deletion of dll when getfactory fails. r=shaver,kipp
git-svn-id: svn://10.0.0.236/trunk@51474 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:04:16 +00:00
dp%netscape.com
51386ed041 Fixed warning of unused variable.
git-svn-id: svn://10.0.0.236/trunk@51473 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:02:29 +00:00
alecf%netscape.com
6b7dfaa5e0 start to consolidate URL and URI parsing into the base classes: remove a whole bunch of protocol-specific code in favor of generalization
basically, more fixes for #14437
r=scottip


git-svn-id: svn://10.0.0.236/trunk@51471 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:02:08 +00:00
dougt%netscape.com
a0ac058370 fix for bug 13894. Hooks up the notification from necko. r=cathleen.
git-svn-id: svn://10.0.0.236/trunk@51470 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:53:01 +00:00
endico%mozilla.org
596192f62c the names of the files to be wrapped must be given relative to the root of the tree. in this case: "../newsbot/newsbot.html"
git-svn-id: svn://10.0.0.236/trunk@51469 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:45:56 +00:00
evaughan%netscape.com
997f5f6291 Fixed bug 9442. reviewed by Hyatt.
git-svn-id: svn://10.0.0.236/trunk@51468 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:38:22 +00:00
mjudge%netscape.com
64c9150aab massive checkin for underlying implementation of key handling from javascript and home/end breakage and.. selecting around NON-text frames. like arrowing around an image for example. 16636,16655 and another i cannot find. r=kin r=hyatt a=me
git-svn-id: svn://10.0.0.236/trunk@51467 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:19:18 +00:00
endico%mozilla.org
6cb5db5eff escape quotes around ALIGN=\"right\"
git-svn-id: svn://10.0.0.236/trunk@51466 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:14:43 +00:00
kipp%netscape.com
845644f460 Alloc another iid
git-svn-id: svn://10.0.0.236/trunk@51465 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:12:31 +00:00
scc%netscape.com
9d0d4095c3 remove "nsVariant.cpp" from the project, and "nsIVariant.h" from the MANIFEST, as per bug #16987, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51464 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:12:03 +00:00
kipp%netscape.com
b9ad416be8 Clean up other dirt
git-svn-id: svn://10.0.0.236/trunk@51463 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:11:54 +00:00
kipp%netscape.com
7944188008 Whoops, missed this during my checkin :-(
git-svn-id: svn://10.0.0.236/trunk@51462 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:11:31 +00:00
davidm%netscape.com
302f64fb59 2425 [PP] Mac: Apprunner doesn't gracefully quit at shutdown or r
r = sdagley


git-svn-id: svn://10.0.0.236/trunk@51461 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:01:45 +00:00
beard%netscape.com
56b367cb81 added parent links, so you can go to the objects referring to a given link.
git-svn-id: svn://10.0.0.236/trunk@51460 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:58:28 +00:00
beard%netscape.com
dfaa46c552 broke out from leaksoup.java so it can be used by tracesoup.
git-svn-id: svn://10.0.0.236/trunk@51459 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:55:25 +00:00
beard%netscape.com
f8e8fae5ce annotates refcount traces with blame/lxr URLs
git-svn-id: svn://10.0.0.236/trunk@51458 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:54:39 +00:00
endico%mozilla.org
62819eff8a align bottom row to the right. <TR ALIGN="right"> doesn't seem to work in mozilla
git-svn-id: svn://10.0.0.236/trunk@51457 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:52:41 +00:00
terry%mozilla.org
575dc47298 Make "checkins in last 7 days" link work better in worlds with
multiple repositories.


git-svn-id: svn://10.0.0.236/trunk@51454 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:42:39 +00:00
nisheeth%netscape.com
9888b796b2 Fixing Unix warnings. r=harishd
git-svn-id: svn://10.0.0.236/trunk@51452 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:27:02 +00:00
akkana%netscape.com
0ab9b94827 Fix a runtime error message -- r= (and suggested by) dp
git-svn-id: svn://10.0.0.236/trunk@51451 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:12:31 +00:00
karnaze%netscape.com
9ecfbb54e1 new regression tests
git-svn-id: svn://10.0.0.236/trunk@51450 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:52:00 +00:00
terry%mozilla.org
2df0186c7f Wasn't working right with multiple repositories.
git-svn-id: svn://10.0.0.236/trunk@51449 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:51:50 +00:00
wtc%netscape.com
096120daf6 Fixed a small mistake in the previous checkin.
git-svn-id: svn://10.0.0.236/trunk@51448 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:51:06 +00:00
danm%netscape.com
4e8be85212 removing (unused) references to nsIWebShell.h. requested by buster@netscape.com, bug 16510, r:me
git-svn-id: svn://10.0.0.236/trunk@51447 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:47:50 +00:00
leaf%mozilla.org
b541cbb7e8 adding !endif to complete !if
git-svn-id: svn://10.0.0.236/trunk@51446 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:40:16 +00:00
endico%mozilla.org
a85345a59b get rid of the <DIV>s and <SPAN>s since we have the rdf file now. the <SPAN> around the article link was messing up the link because they were intertwined <SPAN><A></SPAN>text</A>
git-svn-id: svn://10.0.0.236/trunk@51445 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:38:21 +00:00
wtc%netscape.com
358dfee800 Bugsplat bug #365031: moved the definition of PRStack from pratom.h
to primpl.h so that it is not exported.
Bugsplat bug #364813: declare 'prstk_head' volatile, to prevent compiler
from optimizing away references in a loop.
r=larryh,srinivas@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51444 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:36:35 +00:00
karnaze%netscape.com
a2ae4b6656 bug 5799 - width of auto width table considers percentage cells when they are small relative to the rest of the table. r=dcone
git-svn-id: svn://10.0.0.236/trunk@51443 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:36:21 +00:00
karnaze%netscape.com
ed05316f46 bug 12012 - RemoveFrame was using stale style display. r=dcone
git-svn-id: svn://10.0.0.236/trunk@51442 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:33:30 +00:00
mscott%netscape.com
83fec44fd6 Bug #16538 --> FetchMessage takes a stream listener and we should try to create a necko channel for the url,
and call AsyncRead on the channel, passing in the stream listener instead of trying to run the imap url
through the normal means. This fixes the problem where the channel wasn't properly initialized when
copying a imap message to a local folder.
r=jefft,bienvenu


git-svn-id: svn://10.0.0.236/trunk@51441 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:33:24 +00:00
wtc%netscape.com
646d7cec23 Temporary depend:clean hack.
git-svn-id: svn://10.0.0.236/trunk@51440 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:32:14 +00:00
mscott%netscape.com
fb7a12a36e Bug #16538 --> we need to add nsIStreamObserver to the QI method for this class in order to avoid an assertion
with my fix to bug #16538. I also replaced the handle rolled QueryInterface method with macro.
r=jefft,bienvenu


git-svn-id: svn://10.0.0.236/trunk@51438 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:31:27 +00:00
wtc%netscape.com
c2f76119ac Bugzilla bug #16994: fixed compilation problems on platforms without
long longs. r=larryh@netscape.com.  Thanks to Chris Seawood
<cls@seawood.org> for the bug report.


git-svn-id: svn://10.0.0.236/trunk@51437 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:28:14 +00:00
cata%netscape.com
dd434afd5e bug #16754, r=erik, fixing memory leak
git-svn-id: svn://10.0.0.236/trunk@51436 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:25:44 +00:00
braddr%puremagic.com
8c0a2f84e7 Remove references to nsVariant.cpp and nsIVariant.h.
r=scc


git-svn-id: svn://10.0.0.236/trunk@51435 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:24:17 +00:00
bienvenu%netscape.com
f52e7bdb86 fix syncing of imap flags change to db r=mscott,16839
git-svn-id: svn://10.0.0.236/trunk@51434 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:23:25 +00:00
pnunn%netscape.com
62438f020b bug#13505. Replacing str functions with nsCRT functions, nspr functions.
pnunn@netscape.com  r:jfrancis@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51433 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:23:24 +00:00
rods%netscape.com
c33c65e90f changed the padding so it is adding in the correct left right instead of top bottom
r=kmcclusk, Bug #16936


git-svn-id: svn://10.0.0.236/trunk@51432 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:22:32 +00:00
bienvenu%netscape.com
612130b82a check for null when marking header read, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51431 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:22:07 +00:00
jst%citec.fi
953ba7bb6a Make printing use only enabled stylesheets. No bug, r=kipp@netscape.com and dcone@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51430 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:20:37 +00:00
rogerl%netscape.com
605c46e143 Loop from 1 instead of 0 since the test result parsing gets messed up by
the null strings not containing 'PASSED'. The 0 case isn't all that
important for upperCase testing.


git-svn-id: svn://10.0.0.236/trunk@51429 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:18:52 +00:00
terry%mozilla.org
3b70db325d Add some more debugging output.
git-svn-id: svn://10.0.0.236/trunk@51428 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:04:13 +00:00
ftang%netscape.com
908e81fe11 change the input method highligh code from 2 style to 4 styles. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51427 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:01:18 +00:00
jevering%netscape.com
1e20da8f66 Enabling boehm leak detector, r=dp bug#15906
git-svn-id: svn://10.0.0.236/trunk@51426 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:59:15 +00:00
jevering%netscape.com
42df555a0b Enabling GC detector, r=dp, bug #15906
git-svn-id: svn://10.0.0.236/trunk@51425 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:56:47 +00:00
srinivas%netscape.com
52c617580c Invoke the native acknowledge notify routine only when queue is non-empty.
Checkin for kipp@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@51424 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:52:02 +00:00
akkana%netscape.com
e6c9a60dab 16706: Call the rules code to delete the bogus node before inserting html, to fix the new mail reply code. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@51423 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:51:47 +00:00
kipp%netscape.com
adc0fff019 Added two new tests
git-svn-id: svn://10.0.0.236/trunk@51422 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:46:52 +00:00
endico%mozilla.org
f535016cde oops use '&', not '%'
git-svn-id: svn://10.0.0.236/trunk@51421 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:44:39 +00:00
cata%netscape.com
6499857292 bug #15690, r=ftang, removing bogus rules which were affecting the menu template
git-svn-id: svn://10.0.0.236/trunk@51420 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:42:40 +00:00
danm%netscape.com
5ecf5615a7 observe EventQueue creation and deletion. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51419 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:36:25 +00:00
ramiro%fateware.com
1a2e9974f2 Use "(NSINSTALL) -D" instead of direct "mkdir" r=shaver.
git-svn-id: svn://10.0.0.236/trunk@51418 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:35:37 +00:00
danm%netscape.com
49ae6251f8 adding method ListenToEventQueue (moving EventQueue observation from appshells to appshellservice) r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51417 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:34:57 +00:00
dp%netscape.com
32ccfffb02 bug#14656 Circular release problem of component manager. Fixed by
adding shutdown() method that gets called before the last
release. Enabled only for dp & shaver until we resolve js coredump.


git-svn-id: svn://10.0.0.236/trunk@51416 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:34:39 +00:00
dp%netscape.com
a87080011d Making sample better by using COMPtr r=waterson
git-svn-id: svn://10.0.0.236/trunk@51415 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:32:17 +00:00
dp%netscape.com
480412f60c Addding xpcom init and shutdown. r=waterson
git-svn-id: svn://10.0.0.236/trunk@51414 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:31:53 +00:00
nisheeth%netscape.com
dd57891add Install util.lib to the dist directory in the libs phase rather than the install phase.
git-svn-id: svn://10.0.0.236/trunk@51413 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:31:26 +00:00
endico%mozilla.org
35cedcf521 html escape gt and lt symbols in the View Article url
git-svn-id: svn://10.0.0.236/trunk@51412 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:22:44 +00:00
rhp%netscape.com
7889a5e148 Fix for duplicate body text in Multipart related message - Bug #16992 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@51411 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:18:54 +00:00
mcafee%netscape.com
220ec361b8 Fixing evaughan's last change. r=law
git-svn-id: svn://10.0.0.236/trunk@51410 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:14:59 +00:00
brade%netscape.com
1706386f49 add nsTextContentDataChange.cpp a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@51409 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:14:19 +00:00
ramiro%fateware.com
5244db774f More rpm packaging work in progress. Not part of anything.
git-svn-id: svn://10.0.0.236/trunk@51408 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:12:50 +00:00
edburns%acm.org
24e8fb82df Bug: 15606
r=shaver
approver=av

I would like to take the time to personally thank Mike Shaver for all the hard
work he has done to make this bugfix possible.


git-svn-id: svn://10.0.0.236/trunk@51407 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:09:21 +00:00
rickg%netscape.com
3e6139004b changed default font-size for viewsource; r=none;
git-svn-id: svn://10.0.0.236/trunk@51406 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:05:17 +00:00
mcafee%netscape.com
e9e6fdee20 Backing out evaughan's change which broke linux/solaris. a=mcafee
git-svn-id: svn://10.0.0.236/trunk@51405 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:05:02 +00:00
troy%netscape.com
46c5c77d91 Removed unused 4-byte "mMaxElementSize" member data
git-svn-id: svn://10.0.0.236/trunk@51404 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:51:04 +00:00
kipp%netscape.com
e4442e8177 r=troy; added nsTextContentChangeData to the build
git-svn-id: svn://10.0.0.236/trunk@51403 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:48:43 +00:00
kipp%netscape.com
1e9fb71c5d Support navigators built-in image types internal-gopher-*
git-svn-id: svn://10.0.0.236/trunk@51402 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:48:04 +00:00
kipp%netscape.com
e5f0e5328b Fixed percolation of nbsp's into the transformed buffer (bug 16886)
git-svn-id: svn://10.0.0.236/trunk@51401 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:47:36 +00:00
kipp%netscape.com
c54e23defe r=troy; Optimize append text reflows to only reflow the new part of the text
git-svn-id: svn://10.0.0.236/trunk@51400 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:46:05 +00:00
kipp%netscape.com
fee0551895 moved debug logic for dumping reflow commands so that we can dump them without requiring the incremental reflow verification logic to run
git-svn-id: svn://10.0.0.236/trunk@51399 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:45:39 +00:00
kipp%netscape.com
6b290bc673 r=troy; bug: 15153; fixed problem with style-change reflows not being propogated properly
git-svn-id: svn://10.0.0.236/trunk@51398 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:58 +00:00
kipp%netscape.com
57dac66f2e r=troy; bugs: 13196; fixed floating table reflow issues found in 13196 by storing floater max-element-size for later retrieval
git-svn-id: svn://10.0.0.236/trunk@51397 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:22 +00:00
locka%iol.ie
9ff1e618b5 Changed scope of some helper methods
git-svn-id: svn://10.0.0.236/trunk@51396 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:06 +00:00
kipp%netscape.com
88d3d6afe1 r=troy; bugs: 15153, 13196; fixed problem with style-change reflows not being propogated properly; also fixed floating table reflow issues found in 13196 by storing floater max-element-size for later retrieval
git-svn-id: svn://10.0.0.236/trunk@51395 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:43:48 +00:00
kipp%netscape.com
6156c0fb7a Export the gopher images
git-svn-id: svn://10.0.0.236/trunk@51394 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:42:18 +00:00
kipp%netscape.com
199585b860 Use nsTextContentChangeData to pass down to the reflow logic the effect on the text
git-svn-id: svn://10.0.0.236/trunk@51393 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:40:51 +00:00
kipp%netscape.com
6ef7b73278 new file for text reflow optimiziation
git-svn-id: svn://10.0.0.236/trunk@51392 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:40:25 +00:00
bienvenu%netscape.com
90299835ef fix addrbook mem leaks and mismatched delete r=mscott\
git-svn-id: svn://10.0.0.236/trunk@51391 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:36:02 +00:00
bienvenu%netscape.com
9b4f0c0032 fix msg compose and send mem leaks, ipw, and mismatched delete r=mscott
git-svn-id: svn://10.0.0.236/trunk@51390 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:35:26 +00:00
rickg%netscape.com
eb5f25dfe9 changed default font-size for viewsource; r=none;
git-svn-id: svn://10.0.0.236/trunk@51389 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:34:02 +00:00
locka%iol.ie
f4438b41e1 Added support for drag and drop of Internet Shortcut files
git-svn-id: svn://10.0.0.236/trunk@51388 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:32:52 +00:00
kipp%netscape.com
90d4423420 r=troy; Added a property for max-element-size storage for fixing bug 13196
git-svn-id: svn://10.0.0.236/trunk@51387 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:23:05 +00:00
kipp%netscape.com
4fe7cefb4a r=troy; Added nsITextContetChangeData to help optimize modifications of large text elements
git-svn-id: svn://10.0.0.236/trunk@51386 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:22:02 +00:00
evaughan%netscape.com
f1d7499417 Fixed some warnings: reviewed -hyatt
git-svn-id: svn://10.0.0.236/trunk@51385 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:17:51 +00:00
ramiro%fateware.com
0fed380744 Fix #ifdef DEBUG_ramiro build bustage.
git-svn-id: svn://10.0.0.236/trunk@51384 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:56:05 +00:00
matt%netscape.com
426f9c3ea3 Adding manual proxies -r by bill
git-svn-id: svn://10.0.0.236/trunk@51383 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:53:19 +00:00
ssu%netscape.com
f923fbd1b1 fixed bug #15309. r=dbragg. it now creates an empty Plugins directory within Seamonkey. Not part of tinderbox. would only affect windows.
git-svn-id: svn://10.0.0.236/trunk@51382 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:50:36 +00:00
ramiro%fateware.com
ced5d07b70 Fix #ifdef DEBUG_ramiro build bustage.
git-svn-id: svn://10.0.0.236/trunk@51381 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:30:29 +00:00
selmer%netscape.com
206cd25152 Fix enabling when last NCIfile is deleted
git-svn-id: svn://10.0.0.236/trunk@51379 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 18:39:26 +00:00
terry%mozilla.org
49666a52cb Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51378 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 18:19:48 +00:00
kipp%netscape.com
da5a072040 new
git-svn-id: svn://10.0.0.236/trunk@51374 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 16:20:53 +00:00
briano%netscape.com
363f0cb92d Automated update
git-svn-id: svn://10.0.0.236/trunk@51373 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 15:00:22 +00:00
ramiro%fateware.com
a3613fc446 Work in progress to add reasonable rpm packaging support for the beast.
NOT PART OF THE SEAMONKEY BUILD.


git-svn-id: svn://10.0.0.236/trunk@51372 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 14:57:38 +00:00
ssu%netscape.com
d5686c3a21 fixing bug #16470. Not part of Tinderbox. Not part of seamonkey core code. r=pavlov. Would affect only windows.
git-svn-id: svn://10.0.0.236/trunk@51371 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 07:24:46 +00:00
tbogard%aol.net
8cf4ca3ed6 Added changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51370 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:59:48 +00:00
ssu%netscape.com
ef19fe31d7 removing editor from install build process. Not part of Tinderbox. Not part of seamonkey code. Would affect only windows platforms.
git-svn-id: svn://10.0.0.236/trunk@51369 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:44:27 +00:00
tbogard%aol.net
2f9603aabc Added nsITextScroll.idl.
git-svn-id: svn://10.0.0.236/trunk@51368 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:41:03 +00:00
pierre%netscape.com
2123a4d227 Fix build bustage
git-svn-id: svn://10.0.0.236/trunk@51367 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:40:00 +00:00
tbogard%aol.net
75207bcf9a More changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51366 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:52:54 +00:00
pierre%netscape.com
6b7990dcc7 Enabled MOZ_PERF_METRICS in the Mac build:
- updated DefinesMozilla.h
- fixed stopwatch.cpp
- created libutilIDL.mcp
- added StopWatch exports to libutil.exp
- added xpcom.shlb to libutil.mcp
- added libutil.shlb to htmlparser.mcp, layout.mcp, webshell.mcp


git-svn-id: svn://10.0.0.236/trunk@51365 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:41:45 +00:00
sfraser%netscape.com
68467cb1bb File Removed.
git-svn-id: svn://10.0.0.236/trunk@51364 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:37:53 +00:00
sfraser%netscape.com
7bac435457 Removed nsEditorFactory.cpp and nsEditorShellFactory.cpp which are no longer needed. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51363 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:37:04 +00:00
sfraser%netscape.com
a627d5676e Removal of calls to PR_MumbleMonitor, which were way too heavy-handed for the job. Replaced with PR_AtomicInc/Decrement. part of module sweep, r=morse, pavlov
git-svn-id: svn://10.0.0.236/trunk@51362 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:36:21 +00:00
pierre%netscape.com
1e94740a0f First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51361 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:35:26 +00:00
mcafee%netscape.com
ca26c9bcab Moved to mozilla/tools/tinderbox (client-side script).
git-svn-id: svn://10.0.0.236/trunk@51360 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:20:02 +00:00
mcafee%netscape.com
f7f718532b Added bloat test. Also added --testonly to skip building process. Fixed bloatdiff to put its output to stdout. r=warren
git-svn-id: svn://10.0.0.236/trunk@51359 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:16:54 +00:00
troy%netscape.com
dced08401d r=kipp@netscape.com
Added API to get/set properties on frames. Also changed nsContainerFrame
to use a property to implement the frame overflow list. This saves 4 bytes
per container frames


git-svn-id: svn://10.0.0.236/trunk@51358 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:11:43 +00:00
waterson%netscape.com
41c3d0afa5 Fix solaris (and other unsupported platforms).
git-svn-id: svn://10.0.0.236/trunk@51357 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 04:28:07 +00:00
waterson%netscape.com
a8195254ae Change nsTraceRefCnt::WalkTheStack() to accept stream.
git-svn-id: svn://10.0.0.236/trunk@51355 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:38 +00:00
sfraser%netscape.com
aed61fd72a Removed an errant semicolon in a IID declaration. r=floppy moose
git-svn-id: svn://10.0.0.236/trunk@51354 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:20 +00:00
waterson%netscape.com
035b04b87b Change nsTraceRefcnt::WalkTheStack() to accept stream.
git-svn-id: svn://10.0.0.236/trunk@51353 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:12 +00:00
waterson%netscape.com
21abead461 Modify nsTraceRefcnt::WalkTheStack() to accept a stream. Other misc formatting fixup. work really done by beard, r=waterson.
git-svn-id: svn://10.0.0.236/trunk@51352 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:44:37 +00:00
tbogard%aol.net
ce03f0d9f0 More additions suggested by buster. Not all final, still working out the interfaces.
git-svn-id: svn://10.0.0.236/trunk@51351 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:23:31 +00:00
tbogard%aol.net
c8d824834b More changes to the interface. Merging in changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51350 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:01:33 +00:00
tbogard%aol.net
619f3992f7 Added new nsIDocShellContainer.idl to the build list.
git-svn-id: svn://10.0.0.236/trunk@51349 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:01:10 +00:00
tbogard%aol.net
3b01cf0bec First Check-in.
git-svn-id: svn://10.0.0.236/trunk@51348 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:00:07 +00:00
nisheeth%netscape.com
205adceff6 Should not affect build. Include stopwatch object code if MOZ_PERF is defined.
git-svn-id: svn://10.0.0.236/trunk@51347 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:47:56 +00:00
dveditz%netscape.com
7d2157e059 mac bustage
git-svn-id: svn://10.0.0.236/trunk@51346 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:46:21 +00:00
nisheeth%netscape.com
569e1a2fb1 Fixed warnings. Enabled code to build on UNIX. r=pollmann
git-svn-id: svn://10.0.0.236/trunk@51345 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:32:01 +00:00
endico%mozilla.org
8f060eb994 remove the full path names on newsbot.html and wrapped.html so wrap.pl doesn't add "../" to everything. communicator doesn't mind this but it breaks msie and probably mozilla
git-svn-id: svn://10.0.0.236/trunk@51344 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:30:21 +00:00
briano%netscape.com
4f1d9b3a36 Automated update
git-svn-id: svn://10.0.0.236/trunk@51343 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:15:10 +00:00
nisheeth%netscape.com
3871dd508d Will not affect build. Add support for --enable-perf-metrics autoconf flag that will switch on the reporting of timing information about gecko's layout processes.
git-svn-id: svn://10.0.0.236/trunk@51342 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:01:49 +00:00
varada%netscape.com
6475343232 changing all edit fields with browse buttons to non editable scripts
git-svn-id: svn://10.0.0.236/trunk@51341 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:56:54 +00:00
dveditz%netscape.com
92654b5840 Missed a test
git-svn-id: svn://10.0.0.236/trunk@51340 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:47:28 +00:00
selmer%netscape.com
bea6cdd46f Don't need -MDd in CFLAGS
git-svn-id: svn://10.0.0.236/trunk@51339 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:42:48 +00:00
bienvenu%netscape.com
4e7faff324 fix memory leaks and mismatched frees r=jefft
git-svn-id: svn://10.0.0.236/trunk@51338 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:42:00 +00:00
bienvenu%netscape.com
4392913cc3 fix mismatched free
git-svn-id: svn://10.0.0.236/trunk@51337 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:40:08 +00:00
bienvenu%netscape.com
10931ccb41 another memory leak fix for mime
git-svn-id: svn://10.0.0.236/trunk@51336 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:37:03 +00:00
beard%netscape.com
6bfc31a469 fix :: bustage.
git-svn-id: svn://10.0.0.236/trunk@51334 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:07:50 +00:00
dveditz%netscape.com
6b0912645b Changing nsFileSpec Copy and Move function names to match their
functionality, and also to free up the namespace for a *real* Copy
and Move that allow renaming the leaf name rather than just copying
into different directories (i.e. to make backup files). r=ssu


git-svn-id: svn://10.0.0.236/trunk@51333 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:40:39 +00:00
hoa.nguyen%intel.com
ed3c26548f Optimized decoder. Removed warnings.
git-svn-id: svn://10.0.0.236/trunk@51332 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:17:48 +00:00
beard%netscape.com
a27e6a0c95 when GC_DEBUG is off, try to use GC_malloc_ignore_off_page for large blocks. Since GC_MALLOC always returns cleared blocks, don't bother clearning. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51331 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:17:28 +00:00
dp%netscape.com
af64d101fa Fixed crash on -f file on quit by using async proxy post event as
opposed to calling quit directly. r=dougt


git-svn-id: svn://10.0.0.236/trunk@51330 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:15:30 +00:00
beard%netscape.com
72a36eba4b use nsILeakDetector service. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51329 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:13:07 +00:00
karnaze%netscape.com
fb5466f5e4 bug 14915 - fix crash.
git-svn-id: svn://10.0.0.236/trunk@51328 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:11:55 +00:00
beard%netscape.com
b582d5259b added GC_address_to_source, MWUnmangle exports. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51327 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:09:14 +00:00
beard%netscape.com
eb87b84391 added nsEnvironment.cpp. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51326 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:08:13 +00:00
rods%netscape.com
3133a0f78a removed the PR_MAX forcing the y offset to be zero or greater. Not sure why it was doing this.
r=kmcclusk Bug #16152


git-svn-id: svn://10.0.0.236/trunk@51325 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:06:23 +00:00
beard%netscape.com
abf884842d added GC_address_to_source, MWUnmangle stubs. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51324 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:06:13 +00:00
sspitzer%netscape.com
81245102fa fix for #15231, r=mscott. get the fixed_width pref to stick.
the problem was we had it as an int pref, when it was a bool pref.


git-svn-id: svn://10.0.0.236/trunk@51323 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:50 +00:00
hoa.nguyen%intel.com
4b7e9a7a5a Optimized decoder.
git-svn-id: svn://10.0.0.236/trunk@51322 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:16 +00:00
beard%netscape.com
b12276db98 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51321 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:05 +00:00
hoa.nguyen%intel.com
b52252a4aa Correctly check for the HZ converter engine state.
git-svn-id: svn://10.0.0.236/trunk@51320 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:03:52 +00:00
nhotta%netscape.com
dbcb2cc74d Fix a warning, it was assigning NULL to char type, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51319 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:55:31 +00:00
nhotta%netscape.com
3e99f5b0b8 Adding a wrapper function for a new i18n interface, part of bug fix 15475, r=rhp.
git-svn-id: svn://10.0.0.236/trunk@51318 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:51:25 +00:00
cmanske%netscape.com
661bf267b9 Fixed bug 16923. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51317 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:50:20 +00:00
rods%netscape.com
dd80c9dd09 added check for null frame. The child frame can be null when a comment node exists as
one of the children of the select. r=kmcclusk, Bug #16355


git-svn-id: svn://10.0.0.236/trunk@51316 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:35:38 +00:00
endico%mozilla.org
48d6ca301e clairify that the 'mozilla' module contains the entire 'current' repository, not everything including all the branches.
git-svn-id: svn://10.0.0.236/trunk@51315 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:30:50 +00:00
pierre%netscape.com
a7cee2ccb1 #15636 "Cleanup build warnings". Some compilers issued a "hidden virtual method" warning because only one of the two implementations of GetDesiredSize() was overridden. r=slamm.
git-svn-id: svn://10.0.0.236/trunk@51314 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:30:29 +00:00
hoa.nguyen%intel.com
cfe11b1fd4 Changed from char types to PRUint8.
git-svn-id: svn://10.0.0.236/trunk@51313 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:21:56 +00:00
wtc%netscape.com
e0c8d6770c Made comments match code.
git-svn-id: svn://10.0.0.236/trunk@51312 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:19:31 +00:00
harishd%netscape.com
6cd114ddff Fix for the bustage.
r=pollmann


git-svn-id: svn://10.0.0.236/trunk@51311 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:14:50 +00:00
wtc%netscape.com
eacb3c22ae Bugsplat bug #366840: PR_StringToNetAddr needs to set the address family
field of the PRNetAddr structure. Added a new test str2addr.c for this
bug. r=larryh@netscape.com
Modified files: prnetdb.c, pr/tests/runtests.ksh, pr/tests/Makefile,
    pr/tests/Makefile.in
Added file: pr/tests/str2addr.c


git-svn-id: svn://10.0.0.236/trunk@51310 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:07:38 +00:00
mcafee%netscape.com
9fa424b571 Moving bloatdiff.pl from webtools/tinderbox (server) to here (client).
git-svn-id: svn://10.0.0.236/trunk@51309 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:35:48 +00:00
harishd%netscape.com
676f148787 Fixed Bug 16285 - Replaced char* with nsCAutoString for mBuffer.
This fixes the crash on doing Ctrl-c in editor.

r=akkana


git-svn-id: svn://10.0.0.236/trunk@51308 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:35:12 +00:00
harishd%netscape.com
8cccb6a457 Fixed Bug 16014 - Rectifed a glitch in illegal-content handling code.
r=pollmann


git-svn-id: svn://10.0.0.236/trunk@51307 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:32:10 +00:00
alecf%netscape.com
e0db5266e6 turn news into a nsIModule
r=sspitzer
(porkjockey work)


git-svn-id: svn://10.0.0.236/trunk@51306 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:30:02 +00:00
akkana%netscape.com
49f4e5d7aa 16726: don't print the doctype information in plaintext output. r=cmanske
git-svn-id: svn://10.0.0.236/trunk@51305 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:27:14 +00:00
edburns%acm.org
25735aa125 bug: 16842
reviewer: edburns
approver: edburns

Changed raptor to gk in makefile as appropriate.


git-svn-id: svn://10.0.0.236/trunk@51304 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:02:34 +00:00
rods%netscape.com
54bbcb0dfd added code to the destructor to make sure the list get rolled up.
r=kmcclusk bug 15912


git-svn-id: svn://10.0.0.236/trunk@51303 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:59:04 +00:00
alecf%netscape.com
8d5865d224 clean up nsIMsgFolder API in preparation for fixing a number of bugs, most importantly #14437
r=scottip


git-svn-id: svn://10.0.0.236/trunk@51302 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:58:21 +00:00
dmose%mozilla.org
9cdfa509fd macfe lives on in the MozillaClassic branch, but there's no longer a need for it on the trunk. a=smfr@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51301 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:53:27 +00:00
endico%mozilla.org
47e168172c add m10 tree for the Design Patterns contest
git-svn-id: svn://10.0.0.236/trunk@51300 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:52:08 +00:00
endico%mozilla.org
3d25df00ed merge old changes from when we moved to komodo
git-svn-id: svn://10.0.0.236/trunk@51299 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:48:49 +00:00
mscott%netscape.com
2faa0c76f6 optimize nsImapBuildMessageURI to use a nsCAutoString. This saves us an extra allocation of the string later on.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51298 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:41:18 +00:00
scc%netscape.com
a83d58083d Now InstallFromManifest "xpcom/components/MANIFEST_COMPONENTS" to get some javascript installed in the apps "Components" directory. This corresponds to work shaver has already done on the other platforms. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51297 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:31:46 +00:00
srinivas%netscape.com
ecb0569df7 The "-mno-486" compiler option is no longer relevant and not supported
in new gcc compilers (v2.95). Bug #15975.


git-svn-id: svn://10.0.0.236/trunk@51296 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:19:53 +00:00
bienvenu%netscape.com
0169c2df6e more memory leak fixes, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51295 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:18:25 +00:00
bienvenu%netscape.com
3d780d6859 fix rdf resource value leaks r=jefft
git-svn-id: svn://10.0.0.236/trunk@51294 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:12:00 +00:00
scc%netscape.com
b029ca73a2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51293 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:03:21 +00:00
mscott%netscape.com
899ebce13b Bug #16814 --> i found a problem which may be causing us to block in the imap protocol when downloading larger
attachments or images. Basically, the nsMsgLineStreamBuffer class had a fence post bug when determining
if it had enough room to read in more bytes. If the # of free bytes in the stream buffer was 1 byte and we
had just one byte of data left to read in from the incoming stream, we would fail to read in that one byte.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51292 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:01:58 +00:00
ftang%netscape.com
c683bbd987 do not do TypedText if the character code is 0. r=brade. Fix bug 16570 and 16811
git-svn-id: svn://10.0.0.236/trunk@51291 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:01:20 +00:00
bienvenu%netscape.com
d6cfea3e69 fix mime memory leaks, mostly strings, r=rhp
git-svn-id: svn://10.0.0.236/trunk@51290 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:00:02 +00:00
waldemar%netscape.com
28941388eb Changed bottom expressions to syntax error throws
git-svn-id: svn://10.0.0.236/trunk@51289 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:58:07 +00:00
waldemar%netscape.com
8a4ea2ca19 Added upper-case Greek letters
git-svn-id: svn://10.0.0.236/trunk@51288 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:57:37 +00:00
danm%netscape.com
fe06bcf74b no longer used
git-svn-id: svn://10.0.0.236/trunk@51287 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:51:16 +00:00
bienvenu%netscape.com
21c7cb6d78 fix memory leaks of uri's and a progress string r=mscott
git-svn-id: svn://10.0.0.236/trunk@51286 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:49:45 +00:00
briano%netscape.com
bd0b8a085b Automated update
git-svn-id: svn://10.0.0.236/trunk@51285 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:45:41 +00:00
bienvenu%netscape.com
004de2f422 fix memory leaks in address book r=mscott
git-svn-id: svn://10.0.0.236/trunk@51284 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:41:27 +00:00
mcafee%netscape.com
8d734dfcc2 Adding support for --enable-logrefcnt; off by default in optimized builds, we need this for tinderbox. code=dp, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51283 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:40:01 +00:00
law%netscape.com
64d7ceb5a2 Fix for bug #9131; add dependent=yes feature on find dialog so it behaves properly; r=matt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51282 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:36:08 +00:00
bienvenu%netscape.com
f1140e8c6e fix memory leak of notification uri r=dougt
git-svn-id: svn://10.0.0.236/trunk@51281 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:30:42 +00:00
akkana%netscape.com
b05d4de40d 15777: Don't declare the same function-static symbol twice in the same file, because some versions of gcc can't deal with it. r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51280 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:20:38 +00:00
mcafee%netscape.com
f097b7a2a4 Reviewing and applying pavlov's fix for extra row in color palette. (14315)
git-svn-id: svn://10.0.0.236/trunk@51279 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:14:13 +00:00
akkana%netscape.com
2a83eeebf7 16795: Make arrow keys work again.
The gtk event for arrow keys has length=0, but we still need to generate
KeyDown, KeyPress, etc. events for these keys.  r=pavlov


git-svn-id: svn://10.0.0.236/trunk@51277 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:04:40 +00:00
dougt%netscape.com
48fd2584d2 removing an extra release (16832)
Now doing a QI when getting a proxy so that the IID matches the |in| real
object.

r=jud


git-svn-id: svn://10.0.0.236/trunk@51276 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:04:20 +00:00
akkana%netscape.com
60d8465f63 16844: modifier key presses shouldn't insert anything into the editor. r=brade
git-svn-id: svn://10.0.0.236/trunk@51275 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:02:44 +00:00
varada%netscape.com
459ff2f953 fixes for bug #14014 changed EditBox types to Text in the widgets
git-svn-id: svn://10.0.0.236/trunk@51274 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:59:00 +00:00
putterman%netscape.com
3a0d0bf033 Fixes 15771 and 10603. Scrolling up in tree widget doesn't lose treeitems. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51273 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:48:58 +00:00
bienvenu%netscape.com
6b88f85516 fix memory leak of literal string creating rdf node r=scottip
git-svn-id: svn://10.0.0.236/trunk@51272 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:06:53 +00:00
scc%netscape.com
0d129de64e eliminate warnings, r=shaver
git-svn-id: svn://10.0.0.236/trunk@51271 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:59:00 +00:00
waterson%netscape.com
95123cee1f Bug 15146. Factor nsXULElement's members into prototype and optional 'slots' for heavyweight elements. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51270 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:55:32 +00:00
cmanske%netscape.com
353d58e800 Fixed bug 16868. r=brade
git-svn-id: svn://10.0.0.236/trunk@51269 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:43:56 +00:00
nisheeth%netscape.com
ddb8cb8f28 Changes should not affect build. Ongoing work to make the stopwatch code build on Unix.
git-svn-id: svn://10.0.0.236/trunk@51268 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:43:34 +00:00
bienvenu%netscape.com
b205486bc1 fix memory leak of default pref dir file spec r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51267 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:42:30 +00:00
bienvenu%netscape.com
09d199c08a fix memory leaks with mime string bundles and v-cards r=rhp
git-svn-id: svn://10.0.0.236/trunk@51266 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:41:49 +00:00
sspitzer%netscape.com
ee0c7447a5 fix for #16820, #16821. r=alecf, a=leaf. fix the pre-select the compose "From" identity
based on the selection in the folder pane.  it broken when I removed the FindServerUsingURI()
method a few days ago.  all better now.


git-svn-id: svn://10.0.0.236/trunk@51265 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:31:26 +00:00
leila.garin%eng.sun.com
74762b6d76 Added BWTestThread.java in makefiles, removed print stmt. from TestLoader
git-svn-id: svn://10.0.0.236/trunk@51264 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 17:21:23 +00:00
terry%mozilla.org
3e3cacb732 Ignore the "shadow" and "temp" directories.
git-svn-id: svn://10.0.0.236/trunk@51263 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 16:26:04 +00:00
kipp%netscape.com
deab3a6af2 new
git-svn-id: svn://10.0.0.236/trunk@51262 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:51 +00:00
kipp%netscape.com
aecc167cc9 Use local images
git-svn-id: svn://10.0.0.236/trunk@51261 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:26 +00:00
kipp%netscape.com
d4e0127173 Made test run locally without a net
git-svn-id: svn://10.0.0.236/trunk@51260 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:11 +00:00
terry%mozilla.org
970e03fe63 Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51259 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:17:37 +00:00
dcone%netscape.com
9abd146c48 Fixed the rounded border rendering code to obey solid, and none style types.
Also bumped all the rounded rects onto pixel boundaries before rendering.


git-svn-id: svn://10.0.0.236/trunk@51258 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:46:27 +00:00
law%netscape.com
df6e65595b Fix for bug #?????; Avoid false positive on check for -f cmd line option; r=warren@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51257 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:40:25 +00:00
karnaze%netscape.com
6418d90654 Remove caching cell spacing as margin on cells, reducing 16 bytes and avoiding potentially unique style contexts; simplified cell margin calculations; r=troy
git-svn-id: svn://10.0.0.236/trunk@51256 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:18:56 +00:00
cmanske%netscape.com
5e0a77611f Fixed bugs 12515, 16493,16494,16495,16692,16794,most of 9758. Replaced old 'target' icon with interim 'anchor' icon. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51255 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:15:25 +00:00
terry%mozilla.org
bf28c3efd8 Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51254 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:12:43 +00:00
mscott%netscape.com
2f8bc8e00f Bug #16843 and #16832 where we were crashing when dismissing dialogs. this may not be the final
fix but in an earlier change to this file today, this class stopped addreffing an event queue member variable.
But the dtor still released a reference to the event queue that it didn't have!
The eventual fix may be to put the addref back in there but I need to talk to dougt about this.

this is real danm's fix. i'm the reviewer.


git-svn-id: svn://10.0.0.236/trunk@51253 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 08:35:36 +00:00
danm%netscape.com
f98e5e2bc8 fixing obvious flaw in Unlink. r:waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51252 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 08:35:04 +00:00
tbogard%aol.net
501277d9f2 Integrated some changes made by buster. Still talking some them over, but here for now.
git-svn-id: svn://10.0.0.236/trunk@51251 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 07:37:37 +00:00
cls%seawood.org
47d0316267 Some compilers complain if you declare variables after a potential goto call so move the declarations to the top of the function. Should fix the linux libc5 SM-Ports tinderbox & gcc 2.95 builds.
a=mscott


git-svn-id: svn://10.0.0.236/trunk@51250 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 05:40:05 +00:00
cls%seawood.org
31fb034e97 Use PRBool instead of bool as some compilers do not understand bool. Should fix a couple of SM-Ports tinderboxen.
r=sfraser a=mscott


git-svn-id: svn://10.0.0.236/trunk@51249 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 05:37:18 +00:00
waldemar%netscape.com
e9e8df96c5 Removed types from bottom expressions
git-svn-id: svn://10.0.0.236/trunk@51245 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 02:27:53 +00:00
waldemar%netscape.com
ed5c56be64 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51244 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 02:27:34 +00:00
law%netscape.com
95fc4f832f Fixes for bug #16789; permit OpenDialog to work on hidden window even if document load has not completed yet; r=norris@netscape.com, r=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:25:41 +00:00
cmanske%netscape.com
a978b9e92b Changed a comment. This and last checkin were reviewed by mjudge
git-svn-id: svn://10.0.0.236/trunk@51241 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:06:05 +00:00
cmanske%netscape.com
22bf05aebd Adding menu item to start Composer from Browser debug menu as workaround for bug 16789 (can't start editor on command line). Also removed editor init page from code that's not even run?
git-svn-id: svn://10.0.0.236/trunk@51240 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:03:39 +00:00
edburns%acm.org
8af706c11b Added Swing webclient test code and windows makefile mods.
Author=Ann Sunhachawee
r=edburns@acm.org
Approver=edburns@acm.org
Bug=http://bugzilla.mozilla.org/show_bug.cgi?id=16842


git-svn-id: svn://10.0.0.236/trunk@51239 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:49:28 +00:00
waldemar%netscape.com
cc0c52492a Changed syntax of getters and setters to "get name" and "set name". Relaxed grammar constraints on definitions. Changed over to colon syntax for types. Added local visibility and block modifiers.
git-svn-id: svn://10.0.0.236/trunk@51238 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:46:31 +00:00
evaughan%netscape.com
e5f071ac53 fixed numerous warnings. Reviewed by Hyatt.
git-svn-id: svn://10.0.0.236/trunk@51237 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:46:21 +00:00
waldemar%netscape.com
83bc932793 Removed octal escapes. Replaced bottom by throw of syntax error.
git-svn-id: svn://10.0.0.236/trunk@51236 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:43:58 +00:00
waldemar%netscape.com
db1c1b6e5e Removed octals. Removed rational-to-integer, which was replaced by semantic subtyping. Replaced bottom by throw of syntax error.
git-svn-id: svn://10.0.0.236/trunk@51235 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:43:22 +00:00
waldemar%netscape.com
11aeb1c87d Removed rational-to-integer and types in bottom calls, which were replaced by semantic subtyping
git-svn-id: svn://10.0.0.236/trunk@51234 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:42:17 +00:00
waldemar%netscape.com
f02f9a2f0c Removed rational-to-integer, which was replaced by semantic subtyping
git-svn-id: svn://10.0.0.236/trunk@51233 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:41:59 +00:00
waldemar%netscape.com
1234934b00 Added semantic subtyping, throw, and catch
git-svn-id: svn://10.0.0.236/trunk@51232 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:40:55 +00:00
waldemar%netscape.com
bc5b327059 Fixed bug that would sometimes emit a newline between a backslash and its following escaped character
git-svn-id: svn://10.0.0.236/trunk@51231 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:40:04 +00:00
terry%mozilla.org
60beb90ee5 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51230 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:27:16 +00:00
alecf%netscape.com
30aa1d1d5c remove old gifs
git-svn-id: svn://10.0.0.236/trunk@51229 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:19:23 +00:00
alecf%netscape.com
ba963eb07e remove old gif
git-svn-id: svn://10.0.0.236/trunk@51228 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:18:32 +00:00
alecf%netscape.com
1bfdda92a8 remove unused images
git-svn-id: svn://10.0.0.236/trunk@51227 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:15:50 +00:00
mcafee%netscape.com
fcf9fe791f minor whitespace
git-svn-id: svn://10.0.0.236/trunk@51226 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:14:23 +00:00
larryh%netscape.com
2efaf6b409 BugSplat 367096
git-svn-id: svn://10.0.0.236/trunk@51225 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:12:37 +00:00
norris%netscape.com
b2e9644e2b Work on 1646 [DOGFOOD] javascript: URLs aren't working
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@51224 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:12:04 +00:00
alecf%netscape.com
59c413637f remove old gifs
git-svn-id: svn://10.0.0.236/trunk@51223 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:11:46 +00:00
larryh%netscape.com
eb823e8216 BugSplat 367096
git-svn-id: svn://10.0.0.236/trunk@51222 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:07:01 +00:00
terry%mozilla.org
11426df64d Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51221 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:06:41 +00:00
kipp%netscape.com
7903586ee4 Removed some silly warnings
git-svn-id: svn://10.0.0.236/trunk@51220 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:06:12 +00:00
despotdaemon%netscape.com
4f6f8b68b0 Pseudo-automatic update of changes made by jmas@softcatala.org.
git-svn-id: svn://10.0.0.236/trunk@51219 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:58:29 +00:00
kipp%netscape.com
32b2148862 Added new test
git-svn-id: svn://10.0.0.236/trunk@51218 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:53:31 +00:00
despotdaemon%netscape.com
fc8c4bd300 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@51217 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:51:38 +00:00
pollmann%netscape.com
e0757a21ca Bug 15729: Fall back to content when getting text value; r=vidur
git-svn-id: svn://10.0.0.236/trunk@51216 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:43:58 +00:00
selmer%netscape.com
b2360b9a85 fix for crash on cancel newconfig dialog
git-svn-id: svn://10.0.0.236/trunk@51215 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:43:13 +00:00
alecf%netscape.com
959275c4ac return null identity on null or empty key
no bug
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51214 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:37:54 +00:00
dveditz%netscape.com
c097cd276c reenabling 6986-fix for the mac, r-dougt
git-svn-id: svn://10.0.0.236/trunk@51213 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:17:54 +00:00
despotdaemon%netscape.com
efa03bb824 Pseudo-automatic update of changes made by jmas@softcatala.org.
git-svn-id: svn://10.0.0.236/trunk@51212 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:13:07 +00:00
leaf%mozilla.org
843c7df9fb adding mozilla/embedding and mozilla/docshell to SeaMonkeyCore
git-svn-id: svn://10.0.0.236/trunk@51211 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:09:34 +00:00
kipp%netscape.com
3096ad4a52 r=ftang; fixed off by one error that made return value oPrev inconsistent
git-svn-id: svn://10.0.0.236/trunk@51210 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:06:27 +00:00
kipp%netscape.com
4befc8fe5e Added more tests
git-svn-id: svn://10.0.0.236/trunk@51209 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:55 +00:00
kipp%netscape.com
2d9044ac40 new
git-svn-id: svn://10.0.0.236/trunk@51208 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:33 +00:00
kipp%netscape.com
9c72c46de9 Fixed O(N^2) debug logic bug; speed up paint loop by avoiding painting too much now that we have combined-area (bug 7455, 12297)
git-svn-id: svn://10.0.0.236/trunk@51207 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:19 +00:00
kipp%netscape.com
bbbab95269 update to new nsTextTransformer api
git-svn-id: svn://10.0.0.236/trunk@51206 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:58 +00:00
kipp%netscape.com
6b051cc38a r=ftang; rewrite to fix 16656, parts of 7455
git-svn-id: svn://10.0.0.236/trunk@51205 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:45 +00:00
kipp%netscape.com
d6884c9b41 Init text-transformer during module setup to save cycles (bug 7455)
git-svn-id: svn://10.0.0.236/trunk@51204 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:23 +00:00
amusil%netscape.com
1d95656844 Fixed bug in editing anonymous attributes in database. Now all attributes get modified instead
of only the first.


git-svn-id: svn://10.0.0.236/trunk@51203 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:46:29 +00:00
tbogard%aol.net
c820ac974d More documentation and clean-up of the interfaces.
git-svn-id: svn://10.0.0.236/trunk@51202 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:40:28 +00:00
tbogard%aol.net
e5684d8a64 Added some documentation.
git-svn-id: svn://10.0.0.236/trunk@51201 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:39:57 +00:00
nisheeth%netscape.com
fedd700745 Checkin does not affect build. If MOZ_PERF is set to 1 define the compiler define MOZ_PERF_METRICS for the windows build.
git-svn-id: svn://10.0.0.236/trunk@51200 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:37:53 +00:00
valeski%netscape.com
cc447b7234 14659, r=gagan&warren&dougt
Misc. FTP changes:
*increased FTP buffer read/write size from 4k to 8k.
*removed un-needed (for now) SetPASV() for FTP connection thread
*string optimizations
*FTP Connection thread now uses the NS_IMPL_ISUPPORTS4 macro for addref, rel, and QI methods.
*connection cache key api consolidation (Get()/Remove() combo turned into Remove(key)).

Authentication dialog changes:
*Authentication dialog now includes host name the user is trying to connect to.

nsIRequest support:
*FTP Connection thread now maintains a member variable pointing to it's event queue. It also pumps the event queue in the main loop.
*FTP Connection thread now implemented the nsIRequest interface (never called directly; only via the nsFTPChannel api)
*FTP Channel now uses an xpcom proxy object to make the nsIRequest api calls on the FTP Connection thread.

FTP protocol interpretation changes:
*FTP now handles servers that send multi-line greetings in the first Read() (we blocked indefinately before)
*FTP now parses the parent working directory properly (used to always treat it as '/')


git-svn-id: svn://10.0.0.236/trunk@51199 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:37:47 +00:00
dougt%netscape.com
0377b9291c Fix for bug 16818. xpcom proxy does not handle classes with two or more
interfaces correctly.  What happens is the real object is addref
incorrectly and will never be deleted.

r=jud


git-svn-id: svn://10.0.0.236/trunk@51198 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:35:54 +00:00
dp%netscape.com
fabbeba48e Fixed warnings. r=pam nunn
git-svn-id: svn://10.0.0.236/trunk@51197 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:28:38 +00:00
nisheeth%netscape.com
b7fab4e31c Changes should not affect the build. Renaming the RAPTOR_PERF_METRICS ifdef to MOZ_PERF_METRICS.
git-svn-id: svn://10.0.0.236/trunk@51196 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:27:20 +00:00
dp%netscape.com
bf856b8053 Converting implementations of QueryInterface() to the std one. This
fixes bugs in the previous implementation that caused unbalanced
refcounts and premature releases. Thanks for rpotts for the heads
up. r=pam nunn


git-svn-id: svn://10.0.0.236/trunk@51195 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:27:08 +00:00
cathleen%netscape.com
1f3c5b3ef3 add txmgr.xpt to core list, like the rest of the editor files.
also removed a couple of obsolete files from the list


git-svn-id: svn://10.0.0.236/trunk@51194 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:03:29 +00:00
pnunn%netscape.com
c88ef4fe6e clean up associated with bug#15817, gif decoder. r: dp@netscape.com.
Removing obsolete file.


git-svn-id: svn://10.0.0.236/trunk@51193 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:02:49 +00:00
warren%netscape.com
077b0c94d4 Added 'PageCycler' code so that we can iterate through URL loads (by calling mozilla.exe -f <file-of-urls>). We need this for adding bloat/leaks info to tinderbox. r=law
git-svn-id: svn://10.0.0.236/trunk@51192 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:01:28 +00:00
danm%netscape.com
855118ba4a retire event queues even on Windows when they're no longer used. part of bug 15856. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51191 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:00:12 +00:00
rods%netscape.com
2a900deed8 The code that checked to see whether it should explicitly set focus on the gfx's containing widget
now uget the new focused content's frame instead of using the mCurrentTarget. The mCurrentTarget
is correct for a mouse down but incorrect for a "tab". This is because the mCurrentTarget points at
the currently focused content for a tab event, instead of the new content.
r=joki, bug 11162


git-svn-id: svn://10.0.0.236/trunk@51190 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:57:43 +00:00
pnunn%netscape.com
cc3d6490a5 bug# 16785. r: dp, valeski, neeti. Send mimetype info from channel to imglib.
If no decoder, sniff data stream for mime info.


git-svn-id: svn://10.0.0.236/trunk@51189 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:49:20 +00:00
alla%lysator.liu.se
cba2b194ce Update the GtkMozilla widget so it works. Also updated the streaming interface
so that it works with Necko. Small cleanups.
Fixes 16576 and 14975. r=shaver


git-svn-id: svn://10.0.0.236/trunk@51188 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:46:33 +00:00
norris%netscape.com
0b51721d30 Remove references to unsupported JVM_ calls. Needed for bug 16577.
r=shaver


git-svn-id: svn://10.0.0.236/trunk@51187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:45:29 +00:00
dp%netscape.com
41b9a6b713 Removing prototype of NS_NewDocumentElementFrame. r=evaughan
git-svn-id: svn://10.0.0.236/trunk@51186 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:40:54 +00:00
locka%iol.ie
1e319234e1 Implemented ShowContextMenu so that CBrowse can display custom popup menus in response to right mouse clicks
git-svn-id: svn://10.0.0.236/trunk@51185 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:39:42 +00:00
tbogard%aol.net
ab0c88be9a Ooops, last night removing one warning uncovered another. r=gimpy
git-svn-id: svn://10.0.0.236/trunk@51184 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:34:21 +00:00
terry%mozilla.org
d1fca29577 Need to value_quote() things that go into VALUE attributes in HTML.
git-svn-id: svn://10.0.0.236/trunk@51183 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:27:41 +00:00
despotdaemon%netscape.com
a0b1fe8617 Pseudo-automatic update of changes made by paw@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51182 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:26:55 +00:00
endico%mozilla.org
2e29901945 align "edit products" at the top so its not lost 3 screens down in the products list.
git-svn-id: svn://10.0.0.236/trunk@51181 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:26:39 +00:00
bienvenu%netscape.com
bad04c3403 fix nsImapProtocol leaks r=mscott, no bug #
git-svn-id: svn://10.0.0.236/trunk@51180 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:24:31 +00:00
pierre%netscape.com
9264bc9c89 added stopwatch.cpp to the mac build for nisheeth
git-svn-id: svn://10.0.0.236/trunk@51179 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:12:14 +00:00
slamm%netscape.com
4481922240 Handle clicks properly. Fix for 14857 and 11986. r=rjc
git-svn-id: svn://10.0.0.236/trunk@51178 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:11:39 +00:00
cathleen%netscape.com
2d960ed1c1 additional cleanup, and previous checked in added wallet chrome files, partial fix for bug 15220
git-svn-id: svn://10.0.0.236/trunk@51177 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:09:04 +00:00
rogerl%netscape.com
4e16b4e094 r=norris
Delayed functionDef from creating property until after the body parses
succesfully.


git-svn-id: svn://10.0.0.236/trunk@51176 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:07:45 +00:00
mscott%netscape.com
2fc150a6c8 no bug number. I found that we were making an extra copy of the message body before writing it to the stream.
I was able to fix this by using a nsCString instead of an nsString for the message body. Also, audited the file
to use nsCAutoString instead of nsString to save some extra copying. Used NS_WITH_SERVICE macros for componenet
mananager and register service. Added some com ptr useage too.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@51175 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:06:42 +00:00
rogerl%netscape.com
d0725e4d4e r=norris
Fixed bug #12951 - var if for..in statement should always be of type
string.


git-svn-id: svn://10.0.0.236/trunk@51174 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:06:03 +00:00
neeti%netscape.com
ee6aa2ffd0 updating status
git-svn-id: svn://10.0.0.236/trunk@51172 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:03:33 +00:00
cathleen%netscape.com
0fffda37f6 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51170 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:02:43 +00:00
mscott%netscape.com
6823e8565b Bug #16538 --> pass the emitter into NS_NewPipe as a pipe observer.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@51169 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:02:27 +00:00
mscott%netscape.com
7524389c82 Bug #16538 --> the emitter now supports nsIPipeObserver and we'll now flush our output stream when we are told
it is full. This fixes the problem where large attachements were truncated at 32K.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@51168 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:01:54 +00:00
Jerry.Kirk%Nexwarecorp.com
c40a73a776 Fixes to correct lots of extra drawing because of incorrectly clipped regions
Bug #16698 r=kedl


git-svn-id: svn://10.0.0.236/trunk@51167 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:50:17 +00:00
selmer%netscape.com
2ff1cb0969 CheckListBox supports descriptions (bug #4884)
git-svn-id: svn://10.0.0.236/trunk@51166 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:30:18 +00:00
norris%netscape.com
d201925571 7261 Connect XPConnect visibility filter to query principals
Reviewed by mstoltz.


git-svn-id: svn://10.0.0.236/trunk@51165 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:28:24 +00:00
rods%netscape.com
15f62c11c2 cleaned up warning, result hidding another, r=kmcclusk, (no bug)
git-svn-id: svn://10.0.0.236/trunk@51164 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:59:06 +00:00
rods%netscape.com
959963c9b8 fixed several warning and fixed setting the wrap property enum to off r=kmcclusk, bug 16770
git-svn-id: svn://10.0.0.236/trunk@51163 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:58:07 +00:00
rods%netscape.com
88de486c18 removed comma after last enum, warning clean up, r=kmcclusk (no bug)
git-svn-id: svn://10.0.0.236/trunk@51162 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:56:35 +00:00
varada%netscape.com
0d2cedd9ae setting focus in edit boxes in dialog boxeson init
git-svn-id: svn://10.0.0.236/trunk@51161 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:53:40 +00:00
beard%netscape.com
45cf1dc448 for JBindery runner, added System.exit()
git-svn-id: svn://10.0.0.236/trunk@51160 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:43:31 +00:00
rpotts%netscape.com
0f75f32b71 bug #15560. Changed the LoadGroup to fire notifications via PLEvents to stop reenterency.
git-svn-id: svn://10.0.0.236/trunk@51159 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:42:55 +00:00
terry%mozilla.org
d49cc3e1d1 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51158 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:42:49 +00:00
rpotts%netscape.com
cd23316388 bug #15560. Changed the LoadGroup to fire notifications via PLEvents to stop reenterency.
git-svn-id: svn://10.0.0.236/trunk@51157 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:36:07 +00:00
danm%netscape.com
88e77696a0 added CreateFromIThread. r:valeski@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51156 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:18:27 +00:00
troy%netscape.com
36419b7094 b=16781, r=vidur@netscape.com
Re-ordered destructor to delete maps after destroying the frame hierarchy


git-svn-id: svn://10.0.0.236/trunk@51154 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:37 +00:00
locka%iol.ie
1468b5f4ac Updated to include new registry entries
git-svn-id: svn://10.0.0.236/trunk@51153 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:31 +00:00
selmer%netscape.com
3fd4887790 Removing Recede...
git-svn-id: svn://10.0.0.236/trunk@51152 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:29 +00:00
selmer%netscape.com
5bdff5a335 Putting button names back
git-svn-id: svn://10.0.0.236/trunk@51151 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:04:11 +00:00
shaver%netscape.com
2d88ea3522 corrected assembly, from Ulrich Drepper <drepper@cygnus.com> (16612, r=shaver)
git-svn-id: svn://10.0.0.236/trunk@51150 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:03:01 +00:00
pollmann%netscape.com
7c466fda74 Bug 16725: Enable align attribute for iframe; r=harishd
git-svn-id: svn://10.0.0.236/trunk@51149 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:01:49 +00:00
selmer%netscape.com
7dac51627e Interpret functions moved to interpret.cpp; memory allocations cleaned up
git-svn-id: svn://10.0.0.236/trunk@51148 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 18:58:38 +00:00
leila.garin%eng.sun.com
46abc39ebf New perl automated script.
git-svn-id: svn://10.0.0.236/trunk@51147 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 18:48:53 +00:00
despotdaemon%netscape.com
494eaeb121 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@51146 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 17:34:13 +00:00
despotdaemon%netscape.com
8b64d99548 Pseudo-automatic update of changes made by exv@randomc.com.
git-svn-id: svn://10.0.0.236/trunk@51145 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 17:20:25 +00:00
terry%mozilla.org
9195dc1900 Fixed perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51144 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:41:40 +00:00
norris%netscape.com
bd1c7245f6 Fixed bug. We weren't loading classes in bottom-up dependency order.
Subject:
            Re: another getClassLoader exception
       Date:
            Mon, 18 Oct 1999 22:01:24 -0400
      From:
            Andrew Wason <aw@softcom.com>
        To:
            norris@netscape.com (Norris Boyd)
        CC:
            Howard Lin <howard@softcom.com>
 References:
            1 , 2




At 05:03 PM 10/18/99 -0700, Norris Boyd wrote:
>Are you still seeing this problem?


Yes.  I just did a CVS update to get the latest stuff and we still have
this problem.

I wrote a standalone sample program that duplicates the problem.  Run
JSSupport and you should get this exception:

defineClass org.mozilla.javascript.gen.c2
Exception in thread "main" java.lang.NoClassDefFoundError:
org/mozilla/javascript/gen/c1
         at java.lang.ClassLoader.resolveClass0(Native Method)
         at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
         at
JSSupport$MySecuritySupport$DataClassLoader.loadClass(JSSupport.java:89)
         at JSSupport$MySecuritySupport.defineClass(JSSupport.java:47)
         at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
Compiled Code)
         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)
         at org.mozilla.javascript.Context.evaluateString(Context.java:692)
         at JSSupport.<init>(JSSupport.java:20)
         at JSSupport.main(JSSupport.java:9)



Andrew



>--N
>
>Andrew Wason wrote:
>
> > At 04:54 PM 10/12/99 -0700, Norris Boyd wrote:
> > >I just checked in changes so that the class calling ScriptRuntime (c5
> in your
> > >case) will load the class itself using the normal Java classloading
> mechanism
> > >rather than an explicit call to the class loader. I pushed the bits up
> to the
> > >ftp site, but it takes a bit to propagate.
> >
> > I get this exception now (debugging statements are from my code):
> >
> > SecuritySupport.defineClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c4
> > using default loader com.softcom.realjava.PluginClassLoader@da9486a0
> > java.lang.NoClassDefFoundError: org/mozilla/javascript/gen/c4
> >          at java.lang.ClassLoader.resolveClass0(Native Method)
> >          at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport$Da
> > taClassLoader.loadClass(RealJavaScript.java:410)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport.de
> > fineClass(RealJavaScript.java:352)
> >          at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
> > Compiled Code)
> >          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)
> >
> > So when c5 is being loaded by my SecuritySupport, it also needs to load c4.
> > I decompiled org.mozilla.javascript.gen.c5 and it's constant pool
> > references CLASS org.mozilla.javascript.gen.c4, so c5 is dependent on c4
> > being loadable.  Is the problem that c5 is being loaded before the
> > optimizer has defined c4?
> >
> > I get the above exception for some classes and not others.  It seems
> > consistent that I always get it for classes with dependencies on other
> > optimizer classes that haven't been generated yet.
> >
> > Andrew
> >
> > --
> > Andrew Wason
> > SoftCom, Inc.
> > aw@softcom.com

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



   JSSupport.java

                  Name:
                         JSSupport.java
                   Type:
                         Java Source File (text/java)
                Encoding:
                         base64


git-svn-id: svn://10.0.0.236/trunk@51143 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:38:23 +00:00
terry%mozilla.org
c94f0dfbd5 Fixed perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51142 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:33:06 +00:00
terry%mozilla.org
4d41190cf3 This was using complicated perl features I don't understand, so I simplified it and it works now...
git-svn-id: svn://10.0.0.236/trunk@51141 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:24:48 +00:00
terry%mozilla.org
fae1be4423 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51140 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 15:07:27 +00:00
terry%mozilla.org
c51e515d06 Fix perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51139 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 15:05:16 +00:00
brade%netscape.com
736ea51be4 add images from Dan Haddix (r=pavlov@pavlov.net)
git-svn-id: svn://10.0.0.236/trunk@51138 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:53:55 +00:00
bienvenu%netscape.com
22abb4e345 fix ref count logging on nsMimeImpl r=warren
git-svn-id: svn://10.0.0.236/trunk@51137 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:50:09 +00:00
brade%netscape.com
d885aed29d add images from Dan Haddix (r=rods@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51136 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:44:01 +00:00
troy%netscape.com
0bdf9140d7 Changes to frame property API (code's not being used yet)
git-svn-id: svn://10.0.0.236/trunk@51135 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:41:55 +00:00
rods%netscape.com
186216cd35 changed font-family and margin settings for input text and textareas
r-kmcclusk, Bug #4072


git-svn-id: svn://10.0.0.236/trunk@51134 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:39:59 +00:00
brade%netscape.com
f27c8ca4ba function for image map editor added (contributed by Dan Haddix)
git-svn-id: svn://10.0.0.236/trunk@51133 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:34:34 +00:00
brade%netscape.com
156010fda2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51132 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:32:22 +00:00
brade%netscape.com
2eaffc0b34 add images for Dan Haddix (image map editor)
git-svn-id: svn://10.0.0.236/trunk@51131 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:31:25 +00:00
rods%netscape.com
d3a58b07b8 Changed the sizing comparison for NavQuirks in debug mode to get the font family and size
for the input text  and textarea, I also changed the border calc for only when the
the size is explicitly set.
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51130 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:59:01 +00:00
rods%netscape.com
701a5f632f Moved GetWrapProperty to nsFormControlHelper
Changed add the added of scrollbar sizes for Standard mode
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51129 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:58:53 +00:00
rods%netscape.com
94117fe06b Added methods for getting a frame's current font and
for calculating the nsIFormControlFrame's NavQuirks size
Added two methods for getting the "wrap" property and andded a new enum
for for testing against instead of a string
Added a method for calculating the size when in NavQuirks modes, this currently
duplicates the algorithms for for input text and textareas
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:58:50 +00:00
rods%netscape.com
4df3a52095 Removed old commented out code and unused comments. r=kmcclusk, (no bug)
git-svn-id: svn://10.0.0.236/trunk@51127 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:35:17 +00:00
rods%netscape.com
7df83f9c8c Added a method in the debug build to return the Navigator size for a given
for control for a given font family and size. Used for NavQuirks testing only.
r=kmcclusk, Bugs #3040, 4072


git-svn-id: svn://10.0.0.236/trunk@51126 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:34:00 +00:00
rickg%netscape.com
6dafd0deac fixed bug 16584; CRCRLF not handled correctly. r=syd
git-svn-id: svn://10.0.0.236/trunk@51125 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:52:30 +00:00
tbogard%aol.net
b70777ae81 Removed the last of gimpy's warnings. r=gimpy.
git-svn-id: svn://10.0.0.236/trunk@51124 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:03:11 +00:00
jband%netscape.com
88ae89c00d trivial fix to get rid of warning from copy/paste error - was passing unused argument to printf
git-svn-id: svn://10.0.0.236/trunk@51123 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:00:29 +00:00
tbogard%aol.net
4d16c8e921 Another warning. r=gimpy.
git-svn-id: svn://10.0.0.236/trunk@51122 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:59:20 +00:00
tbogard%aol.net
b17c3685f5 Fixed a few more of gimpy's warnings..... Oh, we found a bug there. r=gimpy Total warnings now under 200!
git-svn-id: svn://10.0.0.236/trunk@51121 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:57:51 +00:00
tbogard%aol.net
8b7f08fbc0 Removing gimpy's warnings. r=gimpy. This brings us down to 200. :)
git-svn-id: svn://10.0.0.236/trunk@51120 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:50:55 +00:00
tbogard%aol.net
ceae1958d8 Removed border from the XUL browser, editor, and iframe tags. This allows content coming up in chromeless pop-up windows not be visually cluttered with a needless border. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51119 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:40:44 +00:00
cls%seawood.org
beb3488154 Add newline at end of file for broken compilers.
git-svn-id: svn://10.0.0.236/trunk@51118 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 06:40:25 +00:00
beard%netscape.com
8af0179bfb changed NSLibraryStartup.o to NSComponentStartup.o, since it's really a component. r=jband
git-svn-id: svn://10.0.0.236/trunk@51117 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 06:31:49 +00:00
jband%netscape.com
defd5464f8 fixing brendan's copy/paste bug that broke gc. r=shaver
git-svn-id: svn://10.0.0.236/trunk@51116 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:58:07 +00:00
dp%netscape.com
ab76ab5c8c Fixing warning. Moved declaration into if 0 block.
git-svn-id: svn://10.0.0.236/trunk@51115 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:49:04 +00:00
cls%seawood.org
8644b9e14b Use PR_TRUE instead of c++ keyword "true" in case of broken/out-of-date compilers.
r=syd


git-svn-id: svn://10.0.0.236/trunk@51114 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:38:27 +00:00
cls%seawood.org
0d7e9393fb Syncing Makefile.ins with srinivas' previous checkin.
r=shaver


git-svn-id: svn://10.0.0.236/trunk@51113 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:30:36 +00:00
troy%netscape.com
85565b9667 Changed a comment
git-svn-id: svn://10.0.0.236/trunk@51112 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:00:30 +00:00
troy%netscape.com
670fa6c8d6 Change to code that's not currently being used. Before it gets used it
will get code reviewed


git-svn-id: svn://10.0.0.236/trunk@51111 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 04:52:33 +00:00
troy%netscape.com
a34fdc41e1 Didn't actually change anything. Just moved two functions up higher in the
file to make the Solaris compiler happy...


git-svn-id: svn://10.0.0.236/trunk@51110 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 04:50:34 +00:00
selmer%netscape.com
727f93afc4 Minor cleanup
git-svn-id: svn://10.0.0.236/trunk@51109 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:46:54 +00:00
alecf%netscape.com
5e8b124880 event targets for checkboxes now reflect reality
(just a test, not part of product)


git-svn-id: svn://10.0.0.236/trunk@51108 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:16:45 +00:00
jefft%netscape.com
668bbc4967 removed obsolete menubar xul tag; fixed bug 16145; r=rhp, ducarroz; a=dp
git-svn-id: svn://10.0.0.236/trunk@51107 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:08:43 +00:00
waterson%netscape.com
6a8fd22671 Obsolete.
git-svn-id: svn://10.0.0.236/trunk@51106 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:05:25 +00:00
beard%netscape.com
de43edf0b2 fixed histogram sorting.
git-svn-id: svn://10.0.0.236/trunk@51105 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:03:12 +00:00
pierre%netscape.com
bdfce7679a Fix build in Mac embedding apps after last week's changes in nsIWebShell.
git-svn-id: svn://10.0.0.236/trunk@51104 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:02:01 +00:00
pierre%netscape.com
f1aa92ba58 Fix a crash in Mac embedding apps: HasGfxScrollBars() checks for null pointer after calling GetPrefs().
git-svn-id: svn://10.0.0.236/trunk@51103 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:00:47 +00:00
alecf%netscape.com
de2e6cfb95 land new DOMViewer branch
no reviewer, not part of product, just a test


git-svn-id: svn://10.0.0.236/trunk@51102 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:46:45 +00:00
selmer%netscape.com
7f47a31e88 Fixes to make enable/disable work in checklist.ini
git-svn-id: svn://10.0.0.236/trunk@51100 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:41:48 +00:00
Jerry.Kirk%Nexwarecorp.com
9518fbd96c moving Push/PopThreadEventQueue to nsIEventQueueService.
This is required to get anythinbg to work now...
r=danm@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51099 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:26:53 +00:00
endico%mozilla.org
b6decda29b search patterns are limited to 29 characters due to the -n option in glimpse
git-svn-id: svn://10.0.0.236/trunk@51098 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:14:09 +00:00
despotdaemon%netscape.com
77a9ed2910 Pseudo-automatic update of changes made by pfong@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51097 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:04:40 +00:00
alecf%netscape.com
6557db6b98 Start to land DOMViewer branch (extension - not part of product)
git-svn-id: svn://10.0.0.236/trunk@51096 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:01:40 +00:00
selmer%netscape.com
e654e9fdbb Changed interpretation & initialization to use onInit and onCommand INI file directives
git-svn-id: svn://10.0.0.236/trunk@51094 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:30:18 +00:00
slamm%netscape.com
0bbf0c1cfd Fix build bustage
git-svn-id: svn://10.0.0.236/trunk@51093 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:29:44 +00:00
sspitzer%netscape.com
ed6cbe944d other part of fix for #15235. fix send later. r=alecf
git-svn-id: svn://10.0.0.236/trunk@51092 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:24:25 +00:00
sspitzer%netscape.com
a8b4e077c5 part of fix for #15235. get send later to work again. r=alecf
git-svn-id: svn://10.0.0.236/trunk@51091 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:23:54 +00:00
despotdaemon%netscape.com
49bc011b9b Pseudo-automatic update of changes made by jfalzon@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51090 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:11:16 +00:00
dougt%netscape.com
fa7e2137bd Fix for bug 14784. Moved pref item up. r=cathleen.
git-svn-id: svn://10.0.0.236/trunk@51089 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:01:51 +00:00
despotdaemon%netscape.com
569c5aba2d Pseudo-automatic update of changes made by scosta@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51088 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:51:34 +00:00
srinivas%netscape.com
263860675d Update with post-3.5 fixes on the tip
git-svn-id: svn://10.0.0.236/trunk@51087 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:40:39 +00:00
pierre%netscape.com
51196f76b4 Fix #12737 "-moz-fixed should be compat mode only". Overwrites the fixed font family with the normal font family in navQuirks mode only. r=pollmann.
git-svn-id: svn://10.0.0.236/trunk@51086 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:31:45 +00:00
Jerry.Kirk%Nexwarecorp.com
3b650617aa Removed some hacks that were no longer necessary because of fixes made
on GFX side to fix nsRegion and the double buffer routines. Also
removed the DOUBLE_CLICK messages as directed by someone, I forget now who.
Bug 16698 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51085 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:29:33 +00:00
Jerry.Kirk%Nexwarecorp.com
03c368d1b3 Various fixes to correct bugs in nsRegionPh and to correct clipping
done by the double buffer routines.
Bug# 16698 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51084 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:27:56 +00:00
selmer%netscape.com
a711824bea Enable/Disable for Network builds
git-svn-id: svn://10.0.0.236/trunk@51083 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:27:21 +00:00
terry%mozilla.org
c4afb2ebc0 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51082 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:25:42 +00:00
terry%mozilla.org
42d190d77d Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51081 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:20:52 +00:00
terry%mozilla.org
877a31dd8a Fix potential security hole (and I think some perl warnings.)
git-svn-id: svn://10.0.0.236/trunk@51080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:17:54 +00:00
larryh%netscape.com
a6a41c799e BugZilla 16566
git-svn-id: svn://10.0.0.236/trunk@51079 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:15:05 +00:00
terry%mozilla.org
2249323ac8 Fixed perl warnings -- this module no longer defines its own "die" routine.
git-svn-id: svn://10.0.0.236/trunk@51078 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:07:23 +00:00
despotdaemon%netscape.com
4654177ca6 Pseudo-automatic update of changes made by jhuntley@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51077 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:05:52 +00:00
terry%mozilla.org
a4508fd4ea Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51076 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:04:59 +00:00
nhotta%netscape.com
a310c234a4 Fixing the linux build bustage.
git-svn-id: svn://10.0.0.236/trunk@51075 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:03:57 +00:00
edburns%acm.org
d2f14fa650 r=neeti@netscape.com
bug: 16679
approved by: neeti@netscape.com

Return NS_ERROR_FAILURE when a cookie is not found.


git-svn-id: svn://10.0.0.236/trunk@51074 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:03:33 +00:00
terry%mozilla.org
35043c37a6 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51073 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:02:42 +00:00
terry%mozilla.org
282909ff22 Fixed stupid perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51072 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:57:58 +00:00
despotdaemon%netscape.com
0f0eb4c9e6 Pseudo-automatic update of changes made by shaver@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51070 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:53:02 +00:00
srinivas%netscape.com
fcf52e9477 Initial version
git-svn-id: svn://10.0.0.236/trunk@51068 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:46:10 +00:00
jband%netscape.com
039dd4adee checking in code to fix bug 12768 submitted by Dan.Oscarsson@trab.se. Needed a 'const char*' tmp varible to work with a 'const char*' buffer that was passed in. The same problem is in both js.c and xpcshell.cpp. r=jband
git-svn-id: svn://10.0.0.236/trunk@51066 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:45:39 +00:00
terry%mozilla.org
f8f7d2f6fc Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51065 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:42:25 +00:00
terry%mozilla.org
565f556bd3 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51064 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:57 +00:00
alecf%netscape.com
bd2182e45d add big comment describing how this dialog works
(no reviewer, no bug, just comments)


git-svn-id: svn://10.0.0.236/trunk@51063 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:53 +00:00
alecf%netscape.com
dd194c9fb7 fix for #15685
r=sspitzer
rdf: prefix on XML attributes was confusing the template


git-svn-id: svn://10.0.0.236/trunk@51062 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:22 +00:00
nhotta%netscape.com
fc73fd2088 Checking in a fix for the linux build bastage,
git-svn-id: svn://10.0.0.236/trunk@51061 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:32:45 +00:00
terry%mozilla.org
94c58cd2a0 Oops; fixed perl error.
git-svn-id: svn://10.0.0.236/trunk@51060 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:32:03 +00:00
terry%mozilla.org
6856a7ee21 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51059 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:23:08 +00:00
jband%netscape.com
fb63cac2a5 checking in bug 16629 fix to cbegle's xpconnect tests submitted by green@FreeBSD.org. This fixes screwy longlong test methods. r=jband
git-svn-id: svn://10.0.0.236/trunk@51058 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:20:16 +00:00
alecf%netscape.com
88779549b8 fix typedef so this compiles with boehm's own makefile or mozilla's makefile.in
git-svn-id: svn://10.0.0.236/trunk@51057 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:17:02 +00:00
alecf%netscape.com
35edd9a187 we should actually be using generic threads so unhide this stuff
git-svn-id: svn://10.0.0.236/trunk@51056 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:15:44 +00:00
briano%netscape.com
2f40b34ffb Automated update
git-svn-id: svn://10.0.0.236/trunk@51055 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:15:10 +00:00
alecf%netscape.com
ad85636e7f build boehm when flag is used r=sspitzer
(last checkin also r=sspitzer)


git-svn-id: svn://10.0.0.236/trunk@51054 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:14:16 +00:00
alecf%netscape.com
a6598d4a1c add flag for boehm (doesn't quite work yet)
git-svn-id: svn://10.0.0.236/trunk@51053 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:13:47 +00:00
waterson%netscape.com
ffa36fb99e Move nsXULElement declaration into the header file.
git-svn-id: svn://10.0.0.236/trunk@51052 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:05:35 +00:00
terry%mozilla.org
8662f77243 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51051 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:04:40 +00:00
terry%mozilla.org
93cd29ad2b Massive spank to put "use strict" in all Bonsai code.
git-svn-id: svn://10.0.0.236/trunk@51050 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:55:01 +00:00
alecf%netscape.com
36d234884e remove makefiles that arent' part of the module anymore
git-svn-id: svn://10.0.0.236/trunk@51049 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:49:05 +00:00
rickg%netscape.com
217ed89f11 fixed bug16624; r=buster. Buffer used to translate unicode entities in forms wasn't being truncated.
git-svn-id: svn://10.0.0.236/trunk@51048 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:39:58 +00:00
ducarroz%netscape.com
4f836323d6 Fix for bug 15313 & 15536. .txt files are now interpreted as XML document. Therefore we need to load a .html file even if it content is purely plain text. R=rhp
git-svn-id: svn://10.0.0.236/trunk@51047 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:38:54 +00:00
sspitzer%netscape.com
01d0e55136 fix for #16259, r=alecf. use the right line endings on the mac. now, instead of putting the LINEBREAK in every string, and then
writing every string to the stream, we do the line ending when we write to the stream.


git-svn-id: svn://10.0.0.236/trunk@51046 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:38:53 +00:00
slamm%netscape.com
3981b8f2c8 Update checkout target. Add logging. Stop on conflicts. r=dougt
git-svn-id: svn://10.0.0.236/trunk@51045 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:33:32 +00:00
nhotta%netscape.com
25c87328ce Changed interface and implementation of nsIEntityConverter,
more entity support (before Latin1 only), added a string based interface. Bug fix 8865, r=ftang.


git-svn-id: svn://10.0.0.236/trunk@51044 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:33:14 +00:00
cata%netscape.com
76ebba554f Conversion to Module. Reviewed by dp. Bug #15589.
git-svn-id: svn://10.0.0.236/trunk@51043 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:23:28 +00:00
troy%netscape.com
c8965f4626 r=kipp@netscape.com Moved ownership of root frame (and frame hierarchy) over to
the frame manager


git-svn-id: svn://10.0.0.236/trunk@51042 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:20:37 +00:00
ftang%netscape.com
2476a575cf fix bug 16656, change the test condiction for NS_PRECONDICTION. also add some error checking code for null ptr. r=erik
git-svn-id: svn://10.0.0.236/trunk@51041 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:17:16 +00:00
waterson%netscape.com
911c570602 Remove nsRDFElement.cpp
git-svn-id: svn://10.0.0.236/trunk@51040 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:08:39 +00:00
waterson%netscape.com
7a9241890d Rename nsRDFElement to nsXULElement; rename nsXULElement to nsXULAggregateElement.
git-svn-id: svn://10.0.0.236/trunk@51039 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:08:15 +00:00
waterson%netscape.com
ce617a2441 Rename nsRDFElement to nsXULElement.
git-svn-id: svn://10.0.0.236/trunk@51038 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:07:36 +00:00
rhp%netscape.com
eff48efacc Change for separating inline attachments - Bug #16367 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51037 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:07:02 +00:00
buster%netscape.com
a8ec8337df some extremely minor cleanup of bugs found by ftang. Thanks, frank.
git-svn-id: svn://10.0.0.236/trunk@51036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:59:19 +00:00
akhil.arora%sun.com
b931259907 16427 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Found some more instances where the DOM spec says that it is not an error
  to return a NULL. Do not throw exceptions in these cases.


git-svn-id: svn://10.0.0.236/trunk@51035 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:53:20 +00:00
pavlov%netscape.com
b8fadf3327 clean up wizard code a bit
git-svn-id: svn://10.0.0.236/trunk@51034 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:52:03 +00:00
rods%netscape.com
ef34fa6834 Links will now scroll into view when they get focus and anchors now respond
to the .focus call from script. r=kmcclusk, Bug #15198


git-svn-id: svn://10.0.0.236/trunk@51033 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:49:38 +00:00
rods%netscape.com
a1a74387d0 Move code to handle focus event into the correct switch statement
r=kmcclusk, bug 7133


git-svn-id: svn://10.0.0.236/trunk@51032 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:47:31 +00:00
akhil.arora%sun.com
479581e81f 16488 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Copy/Paste error- createEntityReference was calling the wrong coreDOM method


git-svn-id: svn://10.0.0.236/trunk@51031 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:44:57 +00:00
pavlov%netscape.com
9bfe6151f6 new files
git-svn-id: svn://10.0.0.236/trunk@51030 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:44:15 +00:00
law%netscape.com
25e63cd81a Bug #14999; stop using toolkit app core; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51029 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:39:18 +00:00
law%netscape.com
45245a0e3f Bug #14999; stop using toolkit app core (added JavaScript[Debug].shlb to this project); r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51028 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:36:57 +00:00
norris%netscape.com
cb1dcdbdc6 Part of bug 7261 "Connect XPConnect visibility filter to query principals"
Reviewed by rhp@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@51027 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:35:52 +00:00
waterson%netscape.com
08c93a00f3 Bug 15558. Fix personal toolbar style rules (patch courtesy dbaron@fas.harvard.edu). r=matt
git-svn-id: svn://10.0.0.236/trunk@51026 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:35:28 +00:00
law%netscape.com
c4ca3de4e5 Bug #14999; stop using toolkit app core; r=davidm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51025 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:33:29 +00:00
pavlov%netscape.com
329e721fff update file list
git-svn-id: svn://10.0.0.236/trunk@51024 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:30:40 +00:00
law%netscape.com
1c3ac7d8fe Bug #14999; stop using toolkit app core; r=ducarroz@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51023 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:29:54 +00:00
bienvenu%netscape.com
cf9daf3b34 change shutdown code to go through nsMessengerBootstrap instead of relying on service shutdown listener or destructors getting called r=alecf
git-svn-id: svn://10.0.0.236/trunk@51022 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:16:23 +00:00
ssu%netscape.com
ef93fdf802 fixing bug #16694. fixes crash bug in the select components dialog in the windows installer. r=sgehani. Affects only windows platform.
git-svn-id: svn://10.0.0.236/trunk@51021 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:15:09 +00:00
dp%netscape.com
068b895d74 Removing extra backslashes at the end of the install lines. Fixing
build.


git-svn-id: svn://10.0.0.236/trunk@51020 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:43:11 +00:00
sspitzer%netscape.com
80c75c7ae1 fix warnings. following alecf's recommendations, remove the FindServerUsingURI() method from the nsIMsgAccountManager, remove CreateFolderInDatasource() from nsIMsgFolder, change several methods in nsMsgCopy to return nsresult, and have nsIMsgFolder ** as an outparam, use GetResource() instead of CreateFolderInDatasource(). use NS_SUCCEEDED() instead of comparing against NS_OK directly.
git-svn-id: svn://10.0.0.236/trunk@51019 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:42:06 +00:00
brade%netscape.com
f24babcd8f make doEditor create an html editor rather than the plaintext editor. (bug #16681; r=sfraser@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51018 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:27:14 +00:00
harishd%netscape.com
cd72403513 Fix for Bug 16126 -- Error message was not getting propagated
to the parser ( CNavDTD::AddLeaf() )
Related to bug 16578 - Throwing userdefined tags to the floor
( what we used to do before ). This will avoid people from being
blocked.   Will work on a fix later.

r=nisheeth


git-svn-id: svn://10.0.0.236/trunk@51017 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:23:27 +00:00
selmer%netscape.com
f641e35434 Enable BoldText type
git-svn-id: svn://10.0.0.236/trunk@51016 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:22:21 +00:00
troy%netscape.com
16faac45a3 Removed delete operators (they had no implementation, they were private so
they wern't accidently called), because HP compiler generated an error if
new operator was public but delete operator was private


git-svn-id: svn://10.0.0.236/trunk@51015 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:16:49 +00:00
nhotta%netscape.com
83699f202b Add new propertie files for html entity, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51014 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:02:20 +00:00
tonyr%fbdesigns.com
b46af177f3 Added string bundles for the mailnews import tools
git-svn-id: svn://10.0.0.236/trunk@51013 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:58:07 +00:00
dougt%netscape.com
921610c409 Fix for 16700. Isolating CreateTransport into new function.
r=gagan.


git-svn-id: svn://10.0.0.236/trunk@51012 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:43:34 +00:00
warren%netscape.com
895b2679fc Made bloatdiff distinguish between no change in leaks, and infinite leakage (no leak before, but leak now).
git-svn-id: svn://10.0.0.236/trunk@51011 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:43:29 +00:00
selmer%netscape.com
ef18489b86 Corrected tab sort order
git-svn-id: svn://10.0.0.236/trunk@51010 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:39:42 +00:00
Jerry.Kirk%Nexwarecorp.com
614348b081 Installed our own PtMainLoop() function that can be exited to allow
the Create Profile Manager to display a dialog, then exit the GUI and display
a different dialog.
Bug# 16667 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51009 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:34:07 +00:00
selmer%netscape.com
fb6169fb87 Temporary fixes for tab ordering
git-svn-id: svn://10.0.0.236/trunk@51008 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:23:11 +00:00
warren%netscape.com
91a872ec09 Took out redundant MOZ_COUNT_CTOR/DTOR calls.
git-svn-id: svn://10.0.0.236/trunk@51007 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:21:53 +00:00
slamm%netscape.com
900a118dd2 Landing of SIDEBAR_19991007_BRANCH. r=waterson
git-svn-id: svn://10.0.0.236/trunk@51006 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:21:52 +00:00
radha%netscape.com
b1aa689e2b Mail news regresion with replying to a message. r=mscott bug # 16550
git-svn-id: svn://10.0.0.236/trunk@51005 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:09:27 +00:00
warren%netscape.com
0ae271237a Made it implement nsIURL as well as nsIURI.
git-svn-id: svn://10.0.0.236/trunk@51004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:07:16 +00:00
warren%netscape.com
671c8baf13 Cleanup to use nsCOMPtrs.
git-svn-id: svn://10.0.0.236/trunk@51003 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:06:57 +00:00
warren%netscape.com
a270067a3a Took out redundant MOZ_COUNT_CTOR/DTOR calls.
git-svn-id: svn://10.0.0.236/trunk@51002 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:06:21 +00:00
troy%netscape.com
a431ec5d07 b=16615. Two line change. Added check for case of root node being a leaf.
The rest of the changes are NOT yet in use. They willbe reviewed by Kipp before
they're turned on


git-svn-id: svn://10.0.0.236/trunk@51001 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:02:09 +00:00
akkana%netscape.com
ae4dba7c09 Remove two ifdef DEBUG_akkana lines that were left in when someone
changed the implementation of ConvertContentToXIF, so that I can
compile again.  This won't affect anyone but me.  r=kipp


git-svn-id: svn://10.0.0.236/trunk@51000 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:01:56 +00:00
troy%netscape.com
3a3c120af6 b=16652, r=troy@netscape.com
Patch from Johnny Stenback that breaks a weak link reference


git-svn-id: svn://10.0.0.236/trunk@50999 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:00:49 +00:00
shaver%netscape.com
408093c6c7 fix // comment in C file (r=brade)
git-svn-id: svn://10.0.0.236/trunk@50998 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:00:18 +00:00
rogerl%netscape.com
b4ac2f29ae Changed tests for ECMA 3 definition of array.length handling.
git-svn-id: svn://10.0.0.236/trunk@50995 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 16:55:44 +00:00
pavlov%netscape.com
2a38ab0914 revert some key code to pre branch landing so that typing works correctly
git-svn-id: svn://10.0.0.236/trunk@50993 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 16:08:16 +00:00
danm%netscape.com
21960bf642 adding PR_LOGging to event queue handling. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50992 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:09:50 +00:00
danm%netscape.com
c4ec5e4d7e moving Push/PopThreadEventQueue to nsIEventQueueService. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50991 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:08:45 +00:00
danm%netscape.com
5bb4aa8eb3 synching with nsWebShellWindow 1.219 (nsIModalWindowSupport removed). r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50990 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:06:38 +00:00
danm%netscape.com
2d0400db89 removing nsIModalWindowSupport r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50989 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:05:17 +00:00
danm%netscape.com
8e456a4690 moving Push/PopThreadEventQueue to nsIEventQueueService r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50988 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:04:18 +00:00
danm%netscape.com
1dff151de6 patch nsEventQueue leak in GetProxyObject r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50987 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:01:40 +00:00
danm%netscape.com
0b71323316 event queues own and delete themselves when they're done. bug 15856 r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50986 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:59:57 +00:00
danm%netscape.com
e200e99d65 new r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50985 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:57:07 +00:00
ftang%netscape.com
c18bf1d357 1. add asserting code to check null ptr
2. add if code and return NS_ERROR_NULL_POINTER if the ptr is null
3. add code to check return value 
r=myself


git-svn-id: svn://10.0.0.236/trunk@50984 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:48:41 +00:00
karnaze%netscape.com
905268d150 added #ifdef for debug printing.
git-svn-id: svn://10.0.0.236/trunk@50983 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:48:19 +00:00
karnaze%netscape.com
0b5271c1c7 bug 15958(partial) - uses mComputedWidth instead of availableSize.width. r=buster; asked hook for permission, got no response.
git-svn-id: svn://10.0.0.236/trunk@50982 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:47:01 +00:00
karnaze%netscape.com
aef57f8136 bug 15993 - in quirks mode allocates space for a 1 pixel border if the content is empty and the table has a border. It was incorrectly, doing this even if the content was not empty. r=buster; asked permission from hook and got no response.
git-svn-id: svn://10.0.0.236/trunk@50981 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:45:41 +00:00
dveditz%netscape.com
038ada687d stopgap for mysterious Mac bustage
git-svn-id: svn://10.0.0.236/trunk@50980 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 12:58:58 +00:00
dveditz%netscape.com
ddf8086d83 generate unique regkeys (6986)
git-svn-id: svn://10.0.0.236/trunk@50979 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 12:06:19 +00:00
srinivas%netscape.com
e8fb19a369 Include fcntl.h always. Bugizlla #16630.
git-svn-id: svn://10.0.0.236/trunk@50978 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 11:13:23 +00:00
dveditz%netscape.com
48a1d530ed variable name change to silence warning
git-svn-id: svn://10.0.0.236/trunk@50977 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 08:35:39 +00:00
dveditz%netscape.com
64356116f8 cleaning up warnings 15626; removing RegisterService/UnregisterService calls per request from dp
git-svn-id: svn://10.0.0.236/trunk@50976 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 05:56:15 +00:00
rickg%netscape.com
756b010b94 another WIP for bug 13536; added charset notification back in; r=harish
git-svn-id: svn://10.0.0.236/trunk@50975 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 05:14:38 +00:00
buster%netscape.com
7653742295 fixed bug 16486, r=brade@netscape.com
windows widget code handles control-key combinations correctly.


git-svn-id: svn://10.0.0.236/trunk@50974 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 03:39:48 +00:00
jband%netscape.com
8013d6bb78 fix typo in comment
git-svn-id: svn://10.0.0.236/trunk@50972 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 02:54:26 +00:00
jband%netscape.com
0a174a879e r=mccabe (I'll be adding more comments to the headers as requested)
Implement nsIXPCNativeCallContext to meet user feature
requirements. This allows simpler implementation of reflection of
native classes into JavaScript in cases where they need to
support legacy interfaces that include optional parameters and
method name overloading. This also provides a general mechanism
for native methods to discover if they were called from JS code,
exactly what JS parameters were passed, explicitly return jsvals,
and throw explicit jsvals without interference from xpconnect.
With test cases.


git-svn-id: svn://10.0.0.236/trunk@50971 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 02:53:04 +00:00
mcafee%netscape.com
6d347761bd Adding perl-path to match other tinderbox files.
git-svn-id: svn://10.0.0.236/trunk@50970 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 01:34:45 +00:00
rickg%netscape.com
c1b9043596 forgot to check this in for viewsource; bug13536; r=harish
git-svn-id: svn://10.0.0.236/trunk@50969 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 00:46:33 +00:00
dveditz%netscape.com
57ed2f138a hoping this fixes the mac bustage
git-svn-id: svn://10.0.0.236/trunk@50968 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:55:56 +00:00
pavlov%netscape.com
0d172a490d work around for not being able to type in text fields on unix without them closing your apps.
16564 and 16542 r=smfr


git-svn-id: svn://10.0.0.236/trunk@50966 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:27:50 +00:00
karnaze%netscape.com
a06cb090a4 new regression tests. does not affect build.
git-svn-id: svn://10.0.0.236/trunk@50965 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:26:02 +00:00
bienvenu%netscape.com
3f482a5e18 fix leak of profile dir in addr book session
git-svn-id: svn://10.0.0.236/trunk@50964 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 22:16:32 +00:00
shaver%netscape.com
b2f619e9fa fixing build by removing leftover #endif
git-svn-id: svn://10.0.0.236/trunk@50963 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 22:15:34 +00:00
dveditz%netscape.com
ea80c313d6 Added NR_RegFlush (14909, required for 16283/16600); warning cleanup (15626) r=shaver
git-svn-id: svn://10.0.0.236/trunk@50962 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:47:53 +00:00
karnaze%netscape.com
cf41a16010 new regression test, doesn't affect build.
git-svn-id: svn://10.0.0.236/trunk@50961 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:46:13 +00:00
dveditz%netscape.com
9d59534945 Added nsIRegistry::Flush (bug 16283, required for 16600), r=shaver
git-svn-id: svn://10.0.0.236/trunk@50960 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:45:53 +00:00
morse%netscape.com
04d5d271eb fix bug 16319, stop assertion failure, r=dp
git-svn-id: svn://10.0.0.236/trunk@50959 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:41:50 +00:00
shaver%netscape.com
8c73db21d3 make View->Use Stylesheet use type=radio. (r=hyatt)
git-svn-id: svn://10.0.0.236/trunk@50958 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:38:21 +00:00
shaver%netscape.com
f2a09249da Added support for type="radio" (pick-one) XP menus.
Cleaned up nsFrame class declaration a bit.
Added some API entries to nsIMenuFrame in support of type="radio"'s
pick-one behaviour.
Renamed UpdateMenuChecked to UpdateMenuSpecialState.
Removed stale string-splitting code in CreateAnonymousContent.
(r=hyatt,mcafee)


git-svn-id: svn://10.0.0.236/trunk@50957 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:37:37 +00:00
mscott%netscape.com
ee5e86e569 Bug #16394 --> no longer need to call intialize after creating a url
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50956 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:59 +00:00
mscott%netscape.com
e396ccade3 Bug #16394 --> extract user name from the url spec. Don't force us to pass it in on initialize.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50955 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:40 +00:00
mscott%netscape.com
79e9036238 Bug #16394 --> Initialize now has no arguments.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50954 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:08 +00:00
mscott%netscape.com
71ebac111b Bug #16394 --> call Initialize function on url after we create one
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50953 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:03:37 +00:00
briano%netscape.com
81d0f9cde9 Automated update
git-svn-id: svn://10.0.0.236/trunk@50952 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:30:18 +00:00
cls%seawood.org
3f3f4e0c22 r=pavlov
Add temporary --enable-nspr-autoconf option to allow platforms to test the newly added autoconf setup for nspr (bug 11893) before turning it on as default.


git-svn-id: svn://10.0.0.236/trunk@50951 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:16:47 +00:00
cls%seawood.org
5e7ffdc098 Bug 11893. r=shaver
Sync the autoconf Makefile.ins.


git-svn-id: svn://10.0.0.236/trunk@50950 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:12:41 +00:00
warren%netscape.com
a53c95056f Added .txt to delta file name.
git-svn-id: svn://10.0.0.236/trunk@50949 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:57:45 +00:00
warren%netscape.com
a0fc33207e Changed format slightly.
git-svn-id: svn://10.0.0.236/trunk@50948 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:52:19 +00:00
warren%netscape.com
990cda09f3 Changed format slightly.
git-svn-id: svn://10.0.0.236/trunk@50947 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:50:09 +00:00
warren%netscape.com
6a7c1e6176 Added bloat log diffing program.
git-svn-id: svn://10.0.0.236/trunk@50946 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:42:27 +00:00
warren%netscape.com
bc35fd61d0 Accidently got added in the wrong directory.
git-svn-id: svn://10.0.0.236/trunk@50945 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:30:25 +00:00
rickg%netscape.com
d16fa469ea removed warnings; no material code affected
git-svn-id: svn://10.0.0.236/trunk@50944 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:01:10 +00:00
karnaze%netscape.com
c96e8acd42 new regression test. does not affect code.
git-svn-id: svn://10.0.0.236/trunk@50943 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 05:17:41 +00:00
karnaze%netscape.com
0ee3058ec4 new regression test
git-svn-id: svn://10.0.0.236/trunk@50942 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:42:37 +00:00
troy%netscape.com
c04a6a88dc r=karnaze@netscape.com Cc'd hyatt@netscape.com
Space optimization. mBorderEdges is no longer an embedded object. Now it's
allocated when needed (for collapsing border model tables only). This saves
80 bytes per table cell frame for the normal HTML case of adjacent border
model


git-svn-id: svn://10.0.0.236/trunk@50941 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:30:11 +00:00
karnaze%netscape.com
84d23e1d2e bug 11321 - Renamed kidMaxElementSize to localKidMaxElementSize and renamed pKidMaxElementSize to kidMaxElementSize and fixed the incorrect usage.
git-svn-id: svn://10.0.0.236/trunk@50940 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:17:53 +00:00
karnaze%netscape.com
906709b8b6 bug 11321 - the frame constructor sets the primary frame when an anonymous table or row group frame is involved.
git-svn-id: svn://10.0.0.236/trunk@50939 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:15:13 +00:00
rickg%netscape.com
1a6a40a3c6 Fix (perf) bug 13536 dealing with viewsource; r=kmcclusk.
Viewsource is now based on XML. These changes make viewsource 2X faster,
30% smaller (in obj code), and uses between 30-60% less markup overhead.
This update also enables stylesheet usage on viewsource, which is controlled
by the viewsource namespace  in html.css.

Also, note that viewsource remains (and always has been) fully incremental.
Remaining performance issues are in contentsink as shown in quantify runs.


git-svn-id: svn://10.0.0.236/trunk@50938 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 02:50:38 +00:00
rickg%netscape.com
7f8bd4a5fc improve debug timing code for ongoing perf work; not enabled in normal build. r=peterl
git-svn-id: svn://10.0.0.236/trunk@50937 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 02:45:26 +00:00
sgehani%netscape.com
9868a31060 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50936 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 01:39:40 +00:00
sgehani%netscape.com
0c1e14a45f File Removed.
git-svn-id: svn://10.0.0.236/trunk@50935 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 01:36:14 +00:00
warren%netscape.com
c81e025f6f Added bloat log diffing program.
git-svn-id: svn://10.0.0.236/trunk@50934 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 00:19:29 +00:00
morse%netscape.com
f4c14fbc7e remove build warning, r=jar
git-svn-id: svn://10.0.0.236/trunk@50933 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 23:37:28 +00:00
morse%netscape.com
2464d177c4 fix bug 15137, open->openDialog, r=jar
git-svn-id: svn://10.0.0.236/trunk@50932 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 23:36:22 +00:00
bienvenu%netscape.com
65fd934be9 fix memory leak of user name r=mscott
git-svn-id: svn://10.0.0.236/trunk@50931 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 22:44:55 +00:00
bienvenu%netscape.com
170bb762af fix leaks in mime xul emitters r=rhp
git-svn-id: svn://10.0.0.236/trunk@50930 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 20:49:06 +00:00
bienvenu%netscape.com
a6a7ff9957 fix memory leak in install notifier r=dougt
git-svn-id: svn://10.0.0.236/trunk@50929 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 20:48:36 +00:00
morse%netscape.com
051b2edf1a fix bug 10434, memory leak detection, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@50928 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 19:34:10 +00:00
rickg%netscape.com
b03845b337 updated FAQ section of nsString documentation
git-svn-id: svn://10.0.0.236/trunk@50927 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:45:18 +00:00
rickg%netscape.com
3169a02cfa WIP bug13536; r=peterl; this code is not used yet
git-svn-id: svn://10.0.0.236/trunk@50926 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:22:24 +00:00
bienvenu%netscape.com
21e8b134dc fix build bustage
git-svn-id: svn://10.0.0.236/trunk@50925 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:16:21 +00:00
bienvenu%netscape.com
0ddfb1fd70 remove unused all threads table r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50924 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 17:55:59 +00:00
troy%netscape.com
3e862c4fc9 Space optimization, r=karnaze@netscape.com Cc'd hyatt@netscape.com
Save 4 bytes by eliminating the mCalculated data member which wasn't being used


git-svn-id: svn://10.0.0.236/trunk@50923 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 16:17:07 +00:00
bienvenu%netscape.com
74fc660d77 fix memory leaks r=mscott
git-svn-id: svn://10.0.0.236/trunk@50922 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 15:43:26 +00:00
karnaze%netscape.com
60203265cd added 2 additional file lists to regression tests to work around new javascript bug.
git-svn-id: svn://10.0.0.236/trunk@50921 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 05:26:22 +00:00
peterl%netscape.com
be312e3eea Made style rules work against nsIMutableStyleContext
r=troy


git-svn-id: svn://10.0.0.236/trunk@50920 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 04:06:04 +00:00
peterl%netscape.com
f3c05f912b Added new style data accessors.
Added nsIMutableStyleContext interface.
Made style rules work against nsIMutableStyleContext
r=troy


git-svn-id: svn://10.0.0.236/trunk@50919 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 04:05:59 +00:00
neeti%netscape.com
a279c2f778 updating status
git-svn-id: svn://10.0.0.236/trunk@50918 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:07:59 +00:00
neeti%netscape.com
f3b4c01e52 Converted dll to use nsIModule - bug 14034, r=dp
git-svn-id: svn://10.0.0.236/trunk@50916 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:05:55 +00:00
neeti%netscape.com
a87ba00c59 Converted dll to use nsIModule -bug 14034, r=jband
git-svn-id: svn://10.0.0.236/trunk@50915 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:04:16 +00:00
rhp%netscape.com
5839f11126 Changes to display when a message is coming from a 5.0 client - Bug #7518 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@50914 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:38:24 +00:00
selmer%netscape.com
347b70512d CheckListBox used
git-svn-id: svn://10.0.0.236/trunk@50913 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:01:01 +00:00
selmer%netscape.com
9a7f96144c CheckListBox incorporated
git-svn-id: svn://10.0.0.236/trunk@50912 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:00:18 +00:00
warren%netscape.com
5cf514e9ae Added total/summary information to bloat log. Made LogNewXPCOM/LogDeleteXPCOM only be needed for losing architectures.
git-svn-id: svn://10.0.0.236/trunk@50911 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:57:18 +00:00
jevering%netscape.com
70a261fb73 The nsLeakDetector.cpp file now requires a few extra header files which weren't being exported on win
git-svn-id: svn://10.0.0.236/trunk@50910 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:44:52 +00:00
jevering%netscape.com
f66066c2c8 Removed a define I shouldn't have checked in.
git-svn-id: svn://10.0.0.236/trunk@50909 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:41:14 +00:00
varada%netscape.com
6f328194ff fixes to bug#7717 on exiting the wizard you get a message stating that data has been saved
git-svn-id: svn://10.0.0.236/trunk@50908 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:40:06 +00:00
jevering%netscape.com
6660a0bc5b Hooking up the Boehm collector.
Can we please call this thing the Bone Collector?  That would be much cooler.
Thank you drive through.


git-svn-id: svn://10.0.0.236/trunk@50907 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:22:01 +00:00
troy%netscape.com
6722de88b9 Added some new code that's not in use yet
git-svn-id: svn://10.0.0.236/trunk@50906 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:55:48 +00:00
rickg%netscape.com
85a81f49a8 WIP for bug13536; r=plinss
git-svn-id: svn://10.0.0.236/trunk@50905 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:39:24 +00:00
varada%netscape.com
54ba582bb1 new struct in header file
git-svn-id: svn://10.0.0.236/trunk@50904 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:16:36 +00:00
beard%netscape.com
7bd68dd578 added code to initialize/shutdown the leak detector. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50903 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:06:37 +00:00
beard%netscape.com
774e39f024 renamed NSInitGarbageCollector/NSShutdownGarbageCollector to NS_, and returning nsresult. Moved leak report file to nsLeakDetector.cpp. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50902 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:06:36 +00:00
beard%netscape.com
371afc89ab added nsLeakDetector.cpp to build. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50901 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:03:45 +00:00
beard%netscape.com
a743954b5c maded entire file conditionally compile #if defined(GC_LEAK_DETECTOR). bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50900 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:02:26 +00:00
jevering%netscape.com
f820994c06 More windows porting of the boehm collector.
git-svn-id: svn://10.0.0.236/trunk@50899 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:45:47 +00:00
bienvenu%netscape.com
7ce48293df fix memory leak of registry location r=warren
git-svn-id: svn://10.0.0.236/trunk@50898 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:45:45 +00:00
cyeh%netscape.com
942579f723 proxy checkin for terry@mozilla.org. quiet warnings about uninitialized
variables at runtime


git-svn-id: svn://10.0.0.236/trunk@50897 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:43:52 +00:00
nisheeth%netscape.com
c916cc6da1 Changes do not get built in regular build. Fix timing hooks in the parser.
git-svn-id: svn://10.0.0.236/trunk@50896 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:42:09 +00:00
kipp%netscape.com
66125fa907 r=troy; revised nsITextContent api to simplify it and the consumers; this is done as prep work for bug 9101
git-svn-id: svn://10.0.0.236/trunk@50895 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:36:07 +00:00
sdagley%netscape.com
8916be1144 Fix #15740 - now check for immediate errors from async i/o calls. Also ensure that io_pending flag for the thread is cleared if we complete the async call before calling WaitOnThisThread(). r=sfraser
git-svn-id: svn://10.0.0.236/trunk@50894 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:35:27 +00:00
kipp%netscape.com
a1aaea4959 r=troy; fixed bug 7093 by carefully pre-computed the collapsed top margin before reflowing the child block and then using that value to properly acquire the available space; In addition, I had to fix an incremental reflow bug associated with this problem
git-svn-id: svn://10.0.0.236/trunk@50893 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:35:10 +00:00
terry%mozilla.org
6f2641b237 Fixed what I believe is just a stupid typo. (This code really needs to have
"use strict" added to it all, and with all the resulting cleanup.)


git-svn-id: svn://10.0.0.236/trunk@50892 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:31:22 +00:00
kipp%netscape.com
17b485a261 Wiped out another warning
git-svn-id: svn://10.0.0.236/trunk@50891 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:29:21 +00:00
kipp%netscape.com
ae469e66fe new
git-svn-id: svn://10.0.0.236/trunk@50890 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:25:02 +00:00
peterl%netscape.com
e8a5d2e937 Added namespace ID to the AttributeChanged notification
Part of the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50889 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:17:53 +00:00
peterl%netscape.com
bba68903df Added namespace ID to the AttributeChanged notification
Part fo the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50888 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:16:45 +00:00
terry%mozilla.org
762178f097 Fixed a bunch of "undefined variable" warnings.
git-svn-id: svn://10.0.0.236/trunk@50887 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:16:32 +00:00
peterl%netscape.com
5e2e0d9a32 Changed reported namespace of attributes from HTML to None.
r=vidur
Also added namespace ID to the AttributeChanged method
Part of the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50886 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:15:17 +00:00
peterl%netscape.com
48baad18a6 Added code to detect generated content that depends on attributes and reflow when the attribute changes
Fix for Bug 15153
r=pierre
Also added namespace ID to the AttributeChanged method
r=troy


git-svn-id: svn://10.0.0.236/trunk@50885 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:14:44 +00:00
varada%netscape.com
d237a54c3d fixes to bug #5987 changed the values of the buttons in the ini files
git-svn-id: svn://10.0.0.236/trunk@50884 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:56:37 +00:00
varada%netscape.com
15123c9a18 fixing bug #5987 - introduced three new fields in VARS in the ini files - cancel back and next - use those to change the text on the buttons
git-svn-id: svn://10.0.0.236/trunk@50883 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:55:06 +00:00
troy%netscape.com
52071cf0b1 Added some new code that isn't being used
git-svn-id: svn://10.0.0.236/trunk@50882 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:53:24 +00:00
gagan%netscape.com
7c5bb7d019 Added "resolving host" status notification for eSocketState_Created. No bug number. r=law.
git-svn-id: svn://10.0.0.236/trunk@50881 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:47:24 +00:00
jefft%netscape.com
f34b34e8a2 back out unneed changes which cause downloading messages to hang; bug 16338, r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50880 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:26:32 +00:00
sfraser%netscape.com
a529a81529 Added nsJSXULEditorElement and nsXULEditorElement for travis. r=travis.
git-svn-id: svn://10.0.0.236/trunk@50879 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:21:43 +00:00
waqar%netscape.com
2e88f3fb20 #9777
r vidur@netscape.com
d The issue was resolved by DOM commitie to allow SplitText to give an error
only on if the start of split is larger than the length. If it is same lenght
it is allowed.


git-svn-id: svn://10.0.0.236/trunk@50878 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:18:23 +00:00
beard%netscape.com
b457512e99 added nsLeakDetector.idl. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50877 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:17:53 +00:00
cmanske%netscape.com
d3b17dbcb9 Fixed bugs 16316, 16494, 16495, all relating to editor file open, saving, and window title issues. r=law
git-svn-id: svn://10.0.0.236/trunk@50876 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:06:41 +00:00
tbogard%aol.net
a7ed2ac01b Changed TextEditorAppShell.xul to use the new XUL editor tag instead of html:iframe. Changed EditorStartup to take an element. Changed EditorStartup to request the EditorShell from the editorElement rather than doing a createInstance and QI. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50875 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:58:49 +00:00
jevering%netscape.com
19f7cec6df Windows makefile for boehm collector.
git-svn-id: svn://10.0.0.236/trunk@50874 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:57:31 +00:00
jevering%netscape.com
7a40245954 Forget continuation line - boehm collector work.
git-svn-id: svn://10.0.0.236/trunk@50873 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:56:51 +00:00
tbogard%aol.net
2aa2164659 Changed html:iframe to the new XUL editor tag. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50872 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:54:42 +00:00
norris%netscape.com
0ad2206225 Fix 16166 setTimeout() security problem
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@50871 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:52:37 +00:00
cls%seawood.org
84b2db2829 Files not used by build. Attempting to resolve cvs checkin problem. a=srinivas,leaf
git-svn-id: svn://10.0.0.236/trunk@50870 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:42:20 +00:00
Jerry.Kirk%Nexwarecorp.com
777d2a990a Fix for viewer bustage on Neutrino. Added call to nsIThread::SetMainThread
in main() of viewer so that it can retrieved in other cases. R=vidur


git-svn-id: svn://10.0.0.236/trunk@50869 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:39:30 +00:00
fur%netscape.com
1242a2627f Renamed variable to avoid a compiler warning. R: mccabe
git-svn-id: svn://10.0.0.236/trunk@50868 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:38:04 +00:00
shaver%netscape.com
a8a9b25086 Make View->Sidebar a type=checkbox menuitem (r=slamm)
git-svn-id: svn://10.0.0.236/trunk@50867 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:37:53 +00:00
cls%seawood.org
b8f8ee7596 Files not used by build. Attempting to resolve cvs checkin problem. a=srinivas,leaf
git-svn-id: svn://10.0.0.236/trunk@50866 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:36:53 +00:00
beard%netscape.com
c69becfcc9 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50865 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:36:04 +00:00
bienvenu%netscape.com
cb256a41dc fix shutdown leak by resetting host session list r=jefft
git-svn-id: svn://10.0.0.236/trunk@50864 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:55 +00:00
beard%netscape.com
ef31ca76db using dumpMemoryLeaks() instead of about:bloat?leaks. bug=15906, r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50863 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:18 +00:00
beard%netscape.com
202835974e added dumpMemoryLeaks(). bug=15906, r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50862 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:11 +00:00
akhil.arora%sun.com
e3af9ebeab 13260 r=akhil.arora@sun.com Fixed by Denis Sharypov <sdv@sparc.spb.su>
Added checks for integer arguments being outside of legal range and
  throw exceptions if not.


git-svn-id: svn://10.0.0.236/trunk@50861 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:25:56 +00:00
cmanske%netscape.com
b3ffd2ef95 Fixed bug 15442 - use about:blank for empty doc URL for editor. r=law
git-svn-id: svn://10.0.0.236/trunk@50860 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:24:45 +00:00
mccabe%netscape.com
dc9018f2ee Fix line editing support for the standalone XPCOM-enabled JavaScript shell. To aid debugging on unix platforms.
To use, define JS_READLINE when compiling mozilla/js/src/xpconnect/shell.

r=shaver


git-svn-id: svn://10.0.0.236/trunk@50859 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:23:53 +00:00
tbogard%aol.net
bb54504747 Adding support for retrieving the EditorShell from editor element. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50858 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:21:10 +00:00
brade%netscape.com
cb5f04d59d use the proper function calls to get the status for alt, shift and meta keys. bug #16486. reviewed valeski@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50857 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:20:57 +00:00
kipp%netscape.com
6b0a23c77d Nuke some more warnings
git-svn-id: svn://10.0.0.236/trunk@50855 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:18:32 +00:00
scc%netscape.com
38a4215c26 Bug #15292, r=dp. Made the component manager inherit from |nsSupportsWeakReference|, fixed its |QueryInterface()| appropriately, and added casts in two places that became ambiguous now that the component manager had multiple |nsISupports| in it. Now one can hold a weak reference to the component manager using |nsIWeakReference|.
git-svn-id: svn://10.0.0.236/trunk@50853 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:14:43 +00:00
law%netscape.com
d169b3d37b Fix for bugs #16525 and #16527, Remove menu separator when not link or frame, add back in missing items; r=matt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50850 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:13:31 +00:00
shaver%netscape.com
130160f659 Add support for type="checkbox" in <menuitem>.
Converted small pile of PRBool to PRPackedBool for space savings.
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50849 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:13:24 +00:00
law%netscape.com
fbce7337a4 Fix for bug #16269, add resizable feature to view-source window, r=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50848 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:11:22 +00:00
Jerry.Kirk%Nexwarecorp.com
bee1ad520f Handles KeyEvents the new way, not completely finished...
Bug # 16539 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50847 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:10:36 +00:00
vidur%netscape.com
6fb05929c2 Fix for viewer bustage on Windows. Added call to nsIThread::SetMainThread in main() of viewer so that it can retrieved in other cases. R=kipp
git-svn-id: svn://10.0.0.236/trunk@50846 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:09:46 +00:00
tbogard%aol.net
a469976da4 Adding support for retrieving the EditorShell from editor element. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50845 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:07:27 +00:00
jefft%netscape.com
ce92446784 remove the size limit for downloading Pop3 message; bug 16338; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50844 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:02:27 +00:00
waterson%netscape.com
d6562a99e8 Darnit. Didn't mean to FORCE_PR_LOG. Removing that #define.
git-svn-id: svn://10.0.0.236/trunk@50843 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:55:54 +00:00
tbogard%aol.net
a4dcc5f6fe First Check-in.
git-svn-id: svn://10.0.0.236/trunk@50842 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:51:58 +00:00
shaver%netscape.com
82e40a8366 Fix case and return value in nsIModule.idl.
Add deleteCategoryEntry and deleteCategory to nsICategoryManager.
Update nsCategoryManager.js to use new nsIModule case, and talk to the registry.
r=brendan


git-svn-id: svn://10.0.0.236/trunk@50841 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:51:38 +00:00
ssu%netscape.com
2c8714f0fe fixes bugs #15884 and #16220. r=dbragg. fixes Install.FileExecute for the
1 parameter format and also the function gets logged correctly in
install.log.


git-svn-id: svn://10.0.0.236/trunk@50840 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:50:49 +00:00
waterson%netscape.com
55b0508a7b Bug 9764. Fix HTML templates to ensure that attribute adding is namespace-agnostic. Add local variable for isUnique so that BuildContentFromTemplate will work if resource- and non-resource elements are siblings in a template. Add logging capability for debug. r=rjc.
git-svn-id: svn://10.0.0.236/trunk@50839 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:47:19 +00:00
ssu%netscape.com
8be86d2e54 fixes bug #6408 and #15393. r=dbragg. fixes windows installer xpinstall
error detection.  Windows platform only"


git-svn-id: svn://10.0.0.236/trunk@50838 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:47:15 +00:00
despotdaemon%netscape.com
3ff30eed90 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50837 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:06:46 +00:00
kipp%netscape.com
54422e686a Eliminate need for networked loaded images
git-svn-id: svn://10.0.0.236/trunk@50836 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 19:44:09 +00:00
slamm%netscape.com
5203f99e62 Need to quote parentheses in ignore pattern.
git-svn-id: svn://10.0.0.236/trunk@50835 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 18:42:27 +00:00
despotdaemon%netscape.com
4e198d349e Pseudo-automatic update of changes made by jst@citec.fi.
git-svn-id: svn://10.0.0.236/trunk@50834 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 17:14:41 +00:00
kipp%netscape.com
93d0d8d38f nuked
git-svn-id: svn://10.0.0.236/trunk@50833 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 16:58:21 +00:00
bienvenu%netscape.com
bc725fb9b5 fix crash reading messages with new profiles
git-svn-id: svn://10.0.0.236/trunk@50831 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 16:09:49 +00:00
beard%netscape.com
4afa5bff04 improved report format, included root list
git-svn-id: svn://10.0.0.236/trunk@50830 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 15:56:05 +00:00
brade%netscape.com
6f185f7761 fixes to handle for control keys (off by 1) (bug #15693) r=kin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50829 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:56:33 +00:00
brade%netscape.com
a7ee842442 don't allow other modifiers when cut/copy/pasting (bug #15693); this missed the keyEvent branch. r=kin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50828 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:52:45 +00:00
kipp%netscape.com
a41c4bbacd Removed old netlib code; changed url loading when crawling to use the event queue to fix some re-entrancy issues somewhat
git-svn-id: svn://10.0.0.236/trunk@50827 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:09:19 +00:00
kipp%netscape.com
f3b0bfeedb Added sorting to the debug dump data for show-frame-size and show-content-size
git-svn-id: svn://10.0.0.236/trunk@50826 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:08:14 +00:00
buster%netscape.com
34185693a8 bug 12221 [Dogfood] Gfx text controls need to notify on mouse events
r=rods@netscape.com
also did some associated performance work, factoring code and collapsing multiple listener
objects down to 1.  This saves a few allocations and about 60 bytes per text control.

bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood approved, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50825 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:38:29 +00:00
buster%netscape.com
4225108b72 bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood approved, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50824 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:37:06 +00:00
buster%netscape.com
dc3e971a7e bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50823 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:36:23 +00:00
buster%netscape.com
ab0550c29d no bug number, part of webshell cleanup. nsIWebShell.h was needlessly included, so I removed it
trivial change, no reviewer.


git-svn-id: svn://10.0.0.236/trunk@50822 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:34:45 +00:00
rods%netscape.com
a38b9c0061 Fixed focus processing, this new code is very close to version 1.54 but more robust,
this fixes bug #7133. It has been compiled and tested on Win, Mac, and Linux.
r=buster,dcone


git-svn-id: svn://10.0.0.236/trunk@50821 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:20:32 +00:00
despotdaemon%netscape.com
b4b7016433 Pseudo-automatic update of changes made by tomk@mitre.org.
git-svn-id: svn://10.0.0.236/trunk@50820 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 11:54:29 +00:00
hyatt%netscape.com
6c5c58d1e8 Fix for 16479. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50819 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:54:43 +00:00
tbogard%aol.net
f56f56047f Fixed a couple of typos.
git-svn-id: svn://10.0.0.236/trunk@50818 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:52:50 +00:00
varada%netscape.com
818b65a0d4 inform function has been changed to take in two parameters to show the filename as well as the directory with absolute path
git-svn-id: svn://10.0.0.236/trunk@50817 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:45:20 +00:00
varada%netscape.com
23669a0409 changes from relative path to absolute path in interpret.cpp and validation of empty entry in ncidialog
git-svn-id: svn://10.0.0.236/trunk@50816 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:43:57 +00:00
jevering%netscape.com
e8deb39b49 Adding boehm collector to windows.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@50815 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:41:54 +00:00
jevering%netscape.com
8c8649671d Adding boehm collector linkages to the windows build.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@50813 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:40:13 +00:00
tbogard%aol.net
8fef749953 Changed the nativeWindowParent's to be a nativeWindow instead of a long. nativeWindow is a typedef'd voidStar.
git-svn-id: svn://10.0.0.236/trunk@50807 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:31:28 +00:00
tbogard%aol.net
9565067a46 First landing.
git-svn-id: svn://10.0.0.236/trunk@50805 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:23:53 +00:00
dp%netscape.com
8b5b037caf bug# 5085 Eliminating some checks at autoreg time to improve startup
performance. r=sfraser


git-svn-id: svn://10.0.0.236/trunk@50803 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:12:08 +00:00
waterson%netscape.com
9f70f9cb52 Add xpcnativecallcontext.cpp for jband.
git-svn-id: svn://10.0.0.236/trunk@50802 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:08:15 +00:00
varada%netscape.com
1882311d32 removing relative paths and evaluating absolute ones
git-svn-id: svn://10.0.0.236/trunk@50801 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:51:03 +00:00
dveditz%netscape.com
20b7b8aa72 expose libreg ability to delete named values in nsIRegistry. Patch from
Jonas Utterström <jonas.utterstrom@vittran.norrnod.se>, r=dveditz


git-svn-id: svn://10.0.0.236/trunk@50800 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:47:58 +00:00
rjc%netscape.com
9621ab20bf Fix leak in nsXULSortService (found by Boehm GC). Also, remove CTOR_COUNT stuff. Review: waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50798 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:27:02 +00:00
brendan%mozilla.org
f2330eb459 1. Fixed missing JS_LOCK_GC in JS_YieldRequest, commented other badness there.
2.  Cleaned up ugly JS_GC_Flag typedef name and put XXXbe comment in there for
    next time: someone seems to have patched around a deadlock that has since
    bit chouck@geocast.com.
3.  Fixed gcDisabled by moving it from cx to rt and updating it atomically.
4.  Fixed ECMA violation where for (var i, j in o) ... was permitted; only one
    variable is allowed.
(Item 4 was a bug on rogerl's list, since closed?  r=shaver@mozilla.org.)


git-svn-id: svn://10.0.0.236/trunk@50795 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:46:42 +00:00
sspitzer%netscape.com
37928e864b fix possible solaris bustage by including the nsIFoo.h files when we have nsCOMPtr<nsIFoo> foo;
git-svn-id: svn://10.0.0.236/trunk@50794 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:10:28 +00:00
jband%netscape.com
32f352bb68 adding new empty placeholder file to the build. Will also add it to Mac project via camelot and put real stuff in it after all is stable. r=jband :)
git-svn-id: svn://10.0.0.236/trunk@50793 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:09:08 +00:00
sspitzer%netscape.com
b3c21470de more fixes to get copies and sent folder prefs to work right.
now, mailbox:// urls work.
change the logic of LocateMessageFolder() to be:

if (the target folder is not "anyfolder://") then {
	find the folder and return it if your find it.
	if you can't find it, create it in the datasource and return the folder.  see bug #14591
}
else {
	look for the default folder in any server associated with the current identity.
	if you find it, return it.
}


git-svn-id: svn://10.0.0.236/trunk@50790 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:03:03 +00:00
waterson%netscape.com
daa650308d Unclutter stuff by using nsCOMPtr in the nsElementMap::ContentListItem. Add leakenmacros to ContentListItem. Fix a leak in the the internal enumerator routine. Comment the internal enumerator routine since it's kinda funky. Add 'tag name' to the log messages.
git-svn-id: svn://10.0.0.236/trunk@50789 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:45:43 +00:00
sspitzer%netscape.com
f6806b13d3 remove unused variablable to fix a couple warnings.
git-svn-id: svn://10.0.0.236/trunk@50788 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:33:21 +00:00
shaver%netscape.com
103a22ed8e fix obj_getCount to property destroy state and propagate error (r=jband)
git-svn-id: svn://10.0.0.236/trunk@50787 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:32:46 +00:00
kin%netscape.com
9af25b17a4 Fix for bug #15360: Drag Selecting, Clicking, then Clicking leaves caret cruft.
r=troy@netscape.com,kipp@netscape.com,evaughan@netscape.com,beard@netscape.com

layout/html/base/src/nsGfxScrollFrame.cpp
    - Renamed all occurrences of ScrollPositionChanged() to
      to ScrollPositionDidChange() to match changes made
      to nsIScrollPositionListener.
    - Added ScrollPositionWillChange() stub method.

layout/html/base/src/nsPresShell.cpp
    - Added PresShellViewEventListener class that implements the
      nsIScrollPositionListener and nsICompositeListener view
      interfaces. This allows us to turn caret rendering on and off
      when scrolling and repainting to prevent leaving caret cruft
      on the screen.
    - PresShellViewEventListener is created in InitialReflow(), and
      released in ~PresShell().

view/public/Makefile.in
view/public/makefile.win
view/public/MANIFEST
    - Added nsICompositeListener to list of files to be exported.

view/public/nsICompositeListener.h
    - New file. Implementers of this interface can register themselves
      with the view manager to receive notification before and after
      a view is composited/refreshed.

view/public/nsIScrollPositionListener.h
    - Added a ScrollPositionWillChange() method.
    - Changed ScrollPositionChanged() to ScrollPositionDidChange().

view/public/nsIViewManager.h
    - Added AddCompositeListener() and RemoveCompositeListener methods.

view/src/nsScrollingView.cpp
view/src/nsScrollingView.h
    - Added NotifyScrollPositionWillChange() and
      NotifyScrollPositionDidChange() methods.
    - Modified HandleScrollEvent() to call NotifyScrollPositionWill/DidChange()
      methods. Added temporary offsetX and offsetY variables to allow us
      to calculate new offsets without changing mOffsetX and mOffsetY before
      notifications are sent out.

view/src/nsScrollPortView.cpp
    - Changed ScrollPositionChanged() to ScrollPositionDidChange().
    - Modified ScrollTo() to call the listener's ScrollPositionWillChange()
      method.

view/src/nsViewManager.cpp
view/src/nsViewManager.h
    - Added AddCompositeListener() and RemoveCompositeListener() methods.
    - Added support for CompositeListener notifications in the Refresh()
      methods for regions and rects.
    - Fix for bug #15901: [DOGFOOD] Selected text does not clear when you type
      Modified UpdateView() so that rects with zero width and height are
      no longer added to our damage region.
      r=beard@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50786 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:29:30 +00:00
karnaze%netscape.com
dcf8e1f205 new regression test.
git-svn-id: svn://10.0.0.236/trunk@50785 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:29:09 +00:00
waterson%netscape.com
033d3bbd40 Fix compiler warning; r=rjc.
git-svn-id: svn://10.0.0.236/trunk@50784 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:26:46 +00:00
neeti%netscape.com
34b93b8117 updating status
git-svn-id: svn://10.0.0.236/trunk@50783 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:20:40 +00:00
karnaze%netscape.com
ef61c5a72c pass2 reflow doesn't request max element sizes to help with bug 14855. Reviewers didn't respond.
git-svn-id: svn://10.0.0.236/trunk@50782 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:09:22 +00:00
brendan%mozilla.org
7c13a9f3b1 Rename ToSource to uneval (r=shaver@mozilla.org,terry@geocast.com).
git-svn-id: svn://10.0.0.236/trunk@50781 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:07:59 +00:00
neeti%netscape.com
898eb50d34 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@50780 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:06:43 +00:00
neeti%netscape.com
6b6c7716c8 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=alecf
git-svn-id: svn://10.0.0.236/trunk@50779 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:06:14 +00:00
neeti%netscape.com
351b6ca2c6 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50778 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:05:22 +00:00
beard%netscape.com
08cd03a169 fixed 2 string memory leaks (bug #15380). r=saari
git-svn-id: svn://10.0.0.236/trunk@50777 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:57:45 +00:00
radha%netscape.com
d7784c7d67 Send out OnStartDocumentLoad(0 notifications for visits to
anchors in a page. bug # 11631 15441. r=law. Got clearance from travis too


git-svn-id: svn://10.0.0.236/trunk@50776 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:50:47 +00:00
bienvenu%netscape.com
78b763db4d more of addrbook memory leak fixes r=mscott
git-svn-id: svn://10.0.0.236/trunk@50774 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:50:21 +00:00
radha%netscape.com
d6dbd3db1f fixing session history for frames. I accidently broke the behavior in
my monday's checkin. No bug #. r=law


git-svn-id: svn://10.0.0.236/trunk@50773 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:49:29 +00:00
troy%netscape.com
be2abd7a2c Patch from jst@citec.fi r=troy@netscape.com
Part of a fix for crash when expanding/collapsing toolbars. Change to
DeletingFrameSubtree() to make sure it examines the additional child
list as well as the principal child list


git-svn-id: svn://10.0.0.236/trunk@50772 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:37:10 +00:00
waterson%netscape.com
1464bedb39 Bug 16402. Make sure that literals addref (and release) the RDF service. Make sure to deal with edge Unregister[Resource|Literal] conditions; e.g., being called to unregister a literal when none was ever registered. r=rjc
git-svn-id: svn://10.0.0.236/trunk@50771 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:36:04 +00:00
jband%netscape.com
df5ae28aef r=shaver
- Fixed two similar cases where code was missing one level of
pointer dereference in terminating a copied string. Was trashing
data further up the stack.
- Use 'nsAllocator::Free' in two similar cases where 'delete' was
mistakenly used. Error pointed out by Purify.


git-svn-id: svn://10.0.0.236/trunk@50770 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:31:09 +00:00
rhp%netscape.com
2caa1592a8 Fix for email names with embedded &'s - Bug #16383 r=jefft
git-svn-id: svn://10.0.0.236/trunk@50769 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:27:33 +00:00
troy%netscape.com
8ec1b4ee83 Space savings. r=kipp@netscape.com
Re-implemented DST code to use separate objects for leaf nodes and
internal nodes. This reduces the per node size from 16 bytes to (on
average) 13 bytes per node


git-svn-id: svn://10.0.0.236/trunk@50768 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:18:28 +00:00
troy%netscape.com
9c1337b86f Space savings. r=karnaze@netscape.com Cc'd hyatt@netscape.com
Eliminated member data mIsContentEmpty and now we use a frame state bit
instead. This saves 4 bytes of space per table cell frame


git-svn-id: svn://10.0.0.236/trunk@50767 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:14:59 +00:00
shaver%netscape.com
9a4de938e7 make xpcshell use jsrtsvc, and let jsrtsvc handle JS_Shutdown (r=jband)
git-svn-id: svn://10.0.0.236/trunk@50766 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:05:48 +00:00
bienvenu%netscape.com
0eddf3358e fix memory leak of nsIURI in Set and GetAttribute r=waterson
git-svn-id: svn://10.0.0.236/trunk@50765 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:59:37 +00:00
srinivas%netscape.com
cc0b044bfe Autoconf for NSPR. Checkin for cls@seawood.org. Bugzilla #11893.
git-svn-id: svn://10.0.0.236/trunk@50764 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:42:36 +00:00
srinivas%netscape.com
6f136bc3f5 Autoconf for NSPR. Checkin for cls@seawood.org. Bugzilla #11893.
git-svn-id: svn://10.0.0.236/trunk@50763 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:36:40 +00:00
peterl%netscape.com
06471a021a moved toggle and tri-state from user-modify to user-select to stay in sync with CSS3
no bug #
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50762 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:11:09 +00:00
cls%seawood.org
e381009988 Fix for bug #13412. r=shaver
If configured using --with-extensions or --with-extension=all, enable all of the non-default extensions rather than extension "yes" or "all".


git-svn-id: svn://10.0.0.236/trunk@50761 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:04:09 +00:00
akhil.arora%sun.com
047329ce0a 16426 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
The class java.lang.RuntimeException was not being pinned


git-svn-id: svn://10.0.0.236/trunk@50760 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:47:04 +00:00
akhil.arora%sun.com
4e04c99aad 16427 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Check before dereferencing a NULL pointer.


git-svn-id: svn://10.0.0.236/trunk@50759 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:43:24 +00:00
varada%netscape.com
b2e2e2a6bc change from relative to absolute path
git-svn-id: svn://10.0.0.236/trunk@50758 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:39:32 +00:00
sspitzer%netscape.com
0d6acc8491 fix for #14892, automatically migrate if we only have one 4.x profile and no 5.0 profiles.
r=mscott.


git-svn-id: svn://10.0.0.236/trunk@50757 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:54 +00:00
akhil.arora%sun.com
0e030fdb50 16424 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Fix two problems that kept the code from compiling on Win32


git-svn-id: svn://10.0.0.236/trunk@50756 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:42 +00:00
varada%netscape.com
cbaf31ef98 getting rid of relative paths in wizardmachine.cpp and wizardui.cpp for generate lists
git-svn-id: svn://10.0.0.236/trunk@50755 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:25 +00:00
varada%netscape.com
0e04699ad6 getting rid of relative paths in accountsetup and checklist inifiles
git-svn-id: svn://10.0.0.236/trunk@50754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:19:25 +00:00
despotdaemon%netscape.com
6e4309cd35 Pseudo-automatic update of changes made by endico@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50753 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:57:31 +00:00
wtc%netscape.com
ef278f909e Bugsplat bug #358401: created a separate .rc file for each DLL. The
product name is "Netscape Portable Runtime" and the file descriptions
are "NSPR Library", "PLDS Library", "PLC Library", and "PRSTRMS Library".
A debug build is indicated in the file description.  The copyright years
changed to 1996-1999.
Modified files: rules.mk, lib/ds/Makefile, lib/ds/Makefile.in,
lib/libc/src/Makefile, lib/libc/src/Makefile.in,
lib/prstreams/Makefile, lib/prstreams/Makefile.in,
prinit.h, nspr.rc
Added files: plds.rc, plc.rc, prstrms.rc
Removed file: resource.h


git-svn-id: svn://10.0.0.236/trunk@50752 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:51:41 +00:00
mcafee%netscape.com
981a0b415a Add #status option so you don't have to scroll down to the tree status.
git-svn-id: svn://10.0.0.236/trunk@50751 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:50:58 +00:00
sspitzer%netscape.com
13ef2ec53a more fixes to the 4.x uri -> 5.0 uri (copies and folders) code, for windows and mac.
#14951.  r=mscott


git-svn-id: svn://10.0.0.236/trunk@50750 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:50:34 +00:00
rpotts%netscape.com
fa27c68f3e bug #16328. Share a single nsToolkit instance among all widgets.
git-svn-id: svn://10.0.0.236/trunk@50749 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:49:11 +00:00
fur%netscape.com
69272dcfcd Initial version of net data cache APIs
git-svn-id: svn://10.0.0.236/trunk@50748 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:46:41 +00:00
kipp%netscape.com
f23d12f0ae Removed two more warnings
git-svn-id: svn://10.0.0.236/trunk@50747 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:29:28 +00:00
leaf%mozilla.org
1388fcf255 adding lib/mac/embedding for pierre -leaf
git-svn-id: svn://10.0.0.236/trunk@50746 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:19:06 +00:00
cathleen%netscape.com
1ba2750fb6 adds jsurl.xpt and html.css to windows packager list
git-svn-id: svn://10.0.0.236/trunk@50745 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:14:44 +00:00
wtc%netscape.com
974a9a3d5c Backed out the Windows resource file stuff checked in in the autoconf
branch merge.  It has two problems: 1. RESOBJ is not being used.  It
has the same meaning as the existing variable RES.  2. $(RES) is added
to OBJS twice on Win32.


git-svn-id: svn://10.0.0.236/trunk@50744 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:14:09 +00:00
nhotta%netscape.com
0cbcded17a Hooking up nsISaveAsCharset to the build, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50743 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:13:00 +00:00
bienvenu%netscape.com
f9c5bba278 fix memory leaks opening and closing dbs r=mscott
git-svn-id: svn://10.0.0.236/trunk@50742 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:11:58 +00:00
nhotta%netscape.com
dbcdcc135b Changed to get a charset name from a locale instead of hard code, also fixed a memory leak, bug=10816, r=tague
git-svn-id: svn://10.0.0.236/trunk@50741 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:11:38 +00:00
nhotta%netscape.com
54747068e8 Additional fallback for not charset labeled input, bug=15766, r=rhp
git-svn-id: svn://10.0.0.236/trunk@50740 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:08:42 +00:00
nhotta%netscape.com
58752631d9 Hooking up nsISaveAsCharset to the build, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50739 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:05:23 +00:00
bienvenu%netscape.com
284cea9db5 fix mork linked list which was disabling more than one table change from getting recorded r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50738 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:05:10 +00:00
shaver%netscape.com
62dca335b0 Fix for 15480 (menu reflow from content change).
Use <titledbutton>, not <div>, for accelerator text to fix alignment
and improve performance _ever_ so slightly.
Initial support for checked menus (needs more magic).
(r=hyatt)


git-svn-id: svn://10.0.0.236/trunk@50737 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:59:18 +00:00
wtc%netscape.com
ad9bb8908b Removed the rule for $(PURE_LIBRARY), which was accidentally
resurrected in the autoconf checkin.


git-svn-id: svn://10.0.0.236/trunk@50736 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:55:27 +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
111 changed files with 19244 additions and 8978 deletions

View File

@@ -1,33 +0,0 @@
#!gmake
#
# 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=..\..
DIRS= \
public \
mgr \
memcache \
filecache \
build \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -1,54 +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
MODULE = nkcache
LIBRARY_NAME = nkcache
IS_COMPONENT = 1
CPPSRCS = nsNetDataCacheModule.cpp
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libnkcachemgr_s.a \
$(DIST)/lib/libnkfilecache_s.a \
$(DIST)/lib/libnkmemcache_s.a \
$(DIST)/lib/libmozdbm_s.a \
$(DIST)/lib/libxpcomio_s.a \
$(NULL)
LOCAL_INCLUDES = \
-I$(DEPTH)/netwerk/cache/memcache \
-I$(DEPTH)/netwerk/cache/filecache \
-I$(DEPTH)/netwerk/cache/mgr \
$(NULL)
EXTRA_DSO_LDOPTS = \
$(MKSHLIB_FORCE_ALL) \
$(SHARED_LIBRARY_LIBS) \
$(MKSHLIB_UNFORCE_ALL) \
$(NULL)
include $(topsrcdir)/config/rules.mk
$(LIBRARY) $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) Makefile

View File

@@ -1,51 +0,0 @@
#!gmake
#
# 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.
#
DEPTH=..\..\..
MODULE=nkcache
MAKE_OBJ_TYPE=DLL
DLLNAME=nkcache
DLL=.\$(OBJDIR)\$(DLLNAME).dll
CPP_OBJS= \
.\$(OBJDIR)\nsNetDataCacheModule.obj \
$(NULL)
LLIBS= \
$(DIST)\lib\nkcachemgr_s.lib \
$(DIST)\lib\nkfilecache_s.lib \
$(DIST)\lib\nkmemcache_s.lib \
$(DIST)\lib\dbm32.lib \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR)
INCS = $(INCS) \
-I$(DEPTH)\netwerk\cache\memcache \
-I$(DEPTH)\netwerk\cache\filecache \
-I$(DEPTH)\netwerk\cache\mgr \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib

View File

@@ -1,49 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
#include "nsCOMPtr.h"
#include "nsIModule.h"
#include "nscore.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIGenericFactory.h"
#include "nsINetDataCache.h"
#include "nsINetDataCacheManager.h"
#include "nsMemCacheCID.h"
#include "nsMemCache.h"
#include "nsNetDiskCache.h"
#include "nsNetDiskCacheCID.h"
#include "nsCacheManager.h"
// Factory method to create a new nsMemCache instance. Used
// by nsNetDataCacheModule
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMemCache, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetDiskCache, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCacheManager, Init)
static nsModuleComponentInfo components[] = {
{ "Memory Cache", NS_MEM_CACHE_FACTORY_CID, NS_NETWORK_MEMORY_CACHE_PROGID, nsMemCacheConstructor },
{ "File Cache", NS_NETDISKCACHE_CID, NS_NETWORK_FILE_CACHE_PROGID, nsNetDiskCacheConstructor },
{ "Cache Manager",NS_CACHE_MANAGER_CID, NS_NETWORK_CACHE_MANAGER_PROGID,nsCacheManagerConstructor }
};
NS_IMPL_NSGETMODULE("Network Data Cache", components)

View File

@@ -1,56 +0,0 @@
#
# 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 Intel Corp.
# Portions created by Intel Corp. are
# Copyright (C) 1999, 1999 Intel Corp. All
# Rights Reserved.
#
# Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
# Carl Wong <carl.wong@intel.com>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = nkcache
LIBRARY_NAME = nkfilecache_s
REQUIRES = nspr dbm
EXTRA_DSO_LDOPTS += -L$(DIST)/lib -lmozdbm_s
EXPORTS=nsNetDiskCacheCID.h
CPPSRCS = \
nsDBAccessor.cpp\
nsDBEnumerator.cpp \
nsNetDiskCache.cpp \
nsDiskCacheRecord.cpp \
nsDiskCacheRecordChannel.cpp \
$(NULL)
EXTRA_LIBS = $(NSPR_LIBS)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

View File

@@ -1,44 +0,0 @@
#!gmake
#
# 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=..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = nkcache
LIBRARY_NAME = nkfilecache_s
CPP_OBJS= \
.\$(OBJDIR)\nsDBAccessor.obj \
.\$(OBJDIR)\nsDBEnumerator.obj \
.\$(OBJDIR)\nsNetDiskCache.obj \
.\$(OBJDIR)\nsDiskCacheRecord.obj \
.\$(OBJDIR)\nsDiskCacheRecordChannel.obj \
$(NULL)
EXPORTS=nsNetDiskCacheCID.h
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -rf $(OBJDIR)
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -1,351 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
// FUR - Add overall description comment here
#include "nsDBAccessor.h"
#include "nscore.h"
#include "prtypes.h"
#include "plhash.h"
#include "nsCRT.h"
#include "nsAutoLock.h"
nsDBAccessor::nsDBAccessor() :
mDB(0) ,
mSessionID(0) ,
mSessionCntr(0)
{
NS_INIT_REFCNT();
}
nsDBAccessor::~nsDBAccessor()
{
printf(" ~nsDBAccessor\n") ;
Shutdown() ;
}
//
// Implement nsISupports methods
//
NS_IMPL_ISUPPORTS(nsDBAccessor, NS_GET_IID(nsIDBAccessor))
///////////////////////////////////////////////////////////
// nsIDBAccessor methods
NS_IMETHODIMP
nsDBAccessor::Init(nsIFileSpec* dbfile)
{
// FUR - lock not needed
m_Lock = PR_NewLock() ;
if(!m_Lock)
return NS_ERROR_OUT_OF_MEMORY ;
char* dbname ;
// this should cover all platforms.
dbfile->GetNativePath(&dbname) ;
// FUR - how is page size chosen ? It's worth putting a comment
// in here about the possible usefulness of tuning these parameters
HASHINFO hash_info = {
16*1024 , /* bucket size */
0 , /* fill factor */
0 , /* number of elements */
0 , /* bytes to cache */
0 , /* hash function */
0} ; /* byte order */
// FUR - lock not needed
nsAutoLock lock(m_Lock) ;
mDB = dbopen(dbname,
O_RDWR | O_CREAT ,
0600 ,
DB_HASH ,
& hash_info) ;
// FUR - does dbname have to be free'ed ?
if(!mDB)
return NS_ERROR_FAILURE ;
// set mSessionID
// FUR - Why the +1 ? (No need for key to be NUL-terminated string.)
PRUint32 len = PL_strlen(SessionKey)+1 ;
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, SessionKey) ;
db_key.size = len ;
int status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == -1) {
NS_ERROR("ERROR: failed get session id in database.") ;
return NS_ERROR_FAILURE ;
}
if(status == 0) {
// get the last session id
PRInt16 *old_ID = NS_STATIC_CAST(PRInt16*, db_data.data) ;
if(*old_ID < ini_sessionID) {
NS_ERROR("ERROR: Bad Session ID in database, corrupted db.") ;
return NS_ERROR_FAILURE ;
}
// FUR - need to comment out all printfs, or turn them into PR_LOG statements
printf("found previous session, id = %d\n", *old_ID) ;
mSessionID = *old_ID + 1 ;
}
else if(status == 1) {
// must be a new db
mSessionID = ini_sessionID ;
}
db_data.data = NS_REINTERPRET_CAST(void*, &mSessionID) ;
db_data.size = sizeof(PRInt16) ;
// store the new session id
status = (*mDB->put)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
(*mDB->sync)(mDB, 0) ;
return NS_OK ;
}
else {
NS_ERROR("reset session ID failure.") ;
return NS_ERROR_FAILURE ;
}
}
NS_IMETHODIMP
nsDBAccessor::Shutdown(void)
{
if(mDB) {
(*mDB->sync)(mDB, 0) ;
(*mDB->close)(mDB) ;
mDB = nsnull ;
}
// FUR - locks not necessary
if(m_Lock)
PR_DestroyLock(m_Lock);
return NS_OK ;
}
NS_IMETHODIMP
nsDBAccessor::Get(PRInt32 aID, void** anEntry, PRUint32 *aLength)
{
if(!anEntry)
return NS_ERROR_NULL_POINTER ;
*anEntry = nsnull ;
*aLength = 0 ;
NS_ASSERTION(mDB, "no database") ;
// Lock the db
nsAutoLock lock(m_Lock) ;
DBT db_key, db_data ;
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
int status = 0 ;
status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
*anEntry = db_data.data ;
*aLength = db_data.size ;
return NS_OK ;
}
else if(status == 1)
return NS_OK ;
else
return NS_ERROR_FAILURE ;
}
NS_IMETHODIMP
nsDBAccessor::Put(PRInt32 aID, void* anEntry, PRUint32 aLength)
{
NS_ASSERTION(mDB, "no database") ;
// Lock the db
nsAutoLock lock(m_Lock) ;
DBT db_key, db_data ;
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
db_data.data = anEntry ;
db_data.size = aLength ;
if(0 == (*mDB->put)(mDB, &db_key, &db_data, 0)) {
// FUR - I would avoid unnecessary sync'ing for performance's
// sake. Maybe you could limit sync to max rate of, say, once
// every few seconds by keeping track of last sync time, using PR_Now().
(*mDB->sync)(mDB, 0) ;
return NS_OK ;
}
else {
// FUR - Try to avoid using NS_ERROR unless error is unrecoverable and serious
NS_ERROR("ERROR: Failed to put anEntry into db.\n") ;
return NS_ERROR_FAILURE ;
}
}
/*
* It's more important to remove the id->metadata entry first since
* key->id mapping is just a reference
*/
NS_IMETHODIMP
nsDBAccessor::Del(PRInt32 aID, void* anEntry, PRUint32 aLength)
{
NS_ASSERTION(mDB, "no database") ;
// FUR - no locks necessary
// Lock the db
nsAutoLock lock(m_Lock) ;
DBT db_key ;
// delete recordID->metadata
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
PRInt32 status = -1 ;
status = (*mDB->del)(mDB, &db_key, 0) ;
if(-1 == status) {
// FUR - no printf's, use PR_LOG, NS_WARNING, or NS_ASSERTION, as the situation warrants
printf(" delete error\n") ;
return NS_ERROR_FAILURE ;
}
// delete key->recordID
db_key.data = anEntry ;
db_key.size = aLength ;
status = (*mDB->del)(mDB, &db_key, 0) ;
if(-1 == status) {
// FUR - no printf's
printf(" delete error\n") ;
return NS_ERROR_FAILURE ;
}
// FUR - Defer sync ? See above
(*mDB->sync)(mDB, 0) ;
return NS_OK ;
}
NS_IMETHODIMP
nsDBAccessor::GetID(const char* key, PRUint32 length, PRInt32* aID)
{
NS_ASSERTION(mDB, "no database") ;
// Lock the db
nsAutoLock lock(m_Lock) ;
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, key) ;
db_key.size = length ;
int status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
// found recordID
*aID = *(NS_REINTERPRET_CAST(PRInt32*, db_data.data)) ;
return NS_OK ;
}
else if(status == 1) {
// create a new one
PRInt32 id = 0 ;
id = mSessionID << 16 | mSessionCntr++ ;
// add new id into mDB
db_data.data = NS_REINTERPRET_CAST(void*, &id) ;
db_data.size = sizeof(PRInt32) ;
status = (*mDB->put)(mDB, &db_key, &db_data, 0) ;
if(status != 0) {
NS_ERROR("updating db failure.") ;
return NS_ERROR_FAILURE ;
}
// FUR - defer sync ?
(*mDB->sync)(mDB, 0) ;
*aID = id ;
return NS_OK ;
}
else {
NS_ERROR("ERROR: keydb failure.") ;
return NS_ERROR_FAILURE ;
}
}
NS_IMETHODIMP
nsDBAccessor::EnumEntry(void** anEntry, PRUint32* aLength, PRBool bReset)
{
if(!anEntry)
return NS_ERROR_NULL_POINTER ;
*anEntry = nsnull ;
*aLength = 0 ;
NS_ASSERTION(mDB, "no database") ;
PRUint32 flag ;
if(bReset)
flag = R_FIRST ;
else
flag = R_NEXT ;
// Lock the db
nsAutoLock lock(m_Lock) ;
DBT db_key, db_data ;
// FUR - +1 unnecessary ?
PRUint32 len = PL_strlen(SessionKey)+1 ;
int status ;
do {
status = (*mDB->seq)(mDB, &db_key, &db_data, flag) ;
flag = R_NEXT ;
if(status == -1)
return NS_ERROR_FAILURE ;
// get next if it's a key->recordID
if(db_key.size > sizeof(PRInt32) && db_data.size == sizeof(PRInt32))
continue ;
// get next if it's a sessionID entry
if(db_key.size == len && db_data.size == sizeof(PRInt16))
continue ;
// recordID is always 32 bits long
if(db_key.size == sizeof(PRInt32))
break ;
} while(!status) ;
if (0 == status) {
*anEntry = db_data.data ;
*aLength = db_data.size ;
}
return NS_OK ;
}

View File

@@ -1,68 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
// FUR - Add overall description comment here
#ifndef _NSIDBACCESSOR_H_
#define _NSIDBACCESSOR_H_
#include "nsIDBAccessor.h"
#include "mcom_db.h"
// bogus string for the key of session id
// FUR - suggest "SK" instead of "^^"
static const char * const SessionKey = "^^" ;
// initial session id number
static const PRInt16 ini_sessionID = 0xff ;
class nsDBAccessor : public nsIDBAccessor
{
public:
NS_DECL_ISUPPORTS
nsDBAccessor() ;
virtual ~nsDBAccessor() ;
NS_IMETHOD Init(nsIFileSpec* dbfile) ;
NS_IMETHOD Shutdown(void) ;
NS_IMETHOD Put(PRInt32 aID, void* anEntry, PRUint32 aLength) ;
NS_IMETHOD Get(PRInt32 aID, void** anEntry, PRUint32 *aLength) ;
NS_IMETHOD Del(PRInt32 aID, void* anEntry, PRUint32 aLength) ;
NS_IMETHOD GetID(const char* key, PRUint32 length, PRInt32* aID) ;
NS_IMETHOD EnumEntry(void* *anEntry, PRUint32* aLength, PRBool bReset) ;
protected:
private:
DB * mDB ;
PRInt16 mSessionID ;
PRInt16 mSessionCntr ;
PRLock * m_Lock ;
} ;
#endif // _NSIDBACCESSOR_H_

View File

@@ -1,97 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
// FUR - Add overall description comment here
#include "nsDBEnumerator.h"
#include "nsDiskCacheRecord.h"
nsDBEnumerator::nsDBEnumerator(nsIDBAccessor* aDB, nsNetDiskCache* aCache) :
m_DB(aDB) ,
m_DiskCache(aCache) ,
tempEntry(0) ,
tempEntry_length(0) ,
m_CacheEntry(0) ,
bReset(PR_TRUE)
{
NS_INIT_REFCNT();
}
nsDBEnumerator::~nsDBEnumerator()
{
// printf(" ~nsDBEnumerator()\n") ;
NS_IF_RELEASE(m_CacheEntry) ;
}
//
// Implement nsISupports methods
//
NS_IMPL_ISUPPORTS(nsDBEnumerator, NS_GET_IID(nsIEnumerator))
/////////////////////////////////////////////////////////////////
// nsISimpleEnumerator methods
NS_IMETHODIMP
nsDBEnumerator::HasMoreElements(PRBool *_retval)
{
*_retval = PR_FALSE ;
m_DB->EnumEntry(&tempEntry, &tempEntry_length, bReset) ;
bReset = PR_FALSE ;
if(tempEntry && tempEntry_length != 0)
*_retval = PR_TRUE ;
return NS_OK ;
}
// this routine does not create a new item by itself
// Rather it reuses the item inside the object. So if you need to use the
// item later, you have to
// create a new item specifically, using copy constructor or some other dup
// function. And don't forget to release it after you're done
//
NS_IMETHODIMP
nsDBEnumerator::GetNext(nsISupports **_retval)
{
if(!m_CacheEntry) {
m_CacheEntry = new nsDiskCacheRecord(m_DB, m_DiskCache) ;
if(m_CacheEntry)
NS_ADDREF(m_CacheEntry) ;
else
return NS_ERROR_OUT_OF_MEMORY ;
}
if(!_retval)
return NS_ERROR_NULL_POINTER ;
*_retval = nsnull ;
nsresult rv = m_CacheEntry->RetrieveInfo(tempEntry, tempEntry_length) ;
if(NS_FAILED(rv))
return rv ;
*_retval = NS_STATIC_CAST(nsISupports*, m_CacheEntry) ;
NS_ADDREF(*_retval) ; // all good getter addref
return NS_OK ;
}

View File

@@ -1,61 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
// FUR - Add overall description comment here
#ifndef _NS_DBENUMERATOR_H_
#define _NS_DBENUMERATOR_H_
#include "nsISimpleEnumerator.h"
#include "nsINetDataCacheRecord.h"
#include "nsIDBAccessor.h"
#include "nsCOMPtr.h"
#include "nsNetDiskCache.h"
#include "nsDiskCacheRecord.h"
class nsCachedDiskData ; /* forward decl */
class nsDBEnumerator : public nsISimpleEnumerator {
public:
NS_DECL_ISUPPORTS
// FUR can use NS_DECL_NSISIMPLEENUMERATOR here
/* boolean HasMoreElements (); */
NS_IMETHOD HasMoreElements(PRBool *_retval) ;
/* nsISupports GetNext (); */
NS_IMETHOD GetNext(nsISupports **_retval) ;
nsDBEnumerator(nsIDBAccessor* aDB, nsNetDiskCache* aCache) ;
virtual ~nsDBEnumerator() ;
// FUR all members should be prefixed by 'm', e.g. mbReset
private:
nsCOMPtr<nsIDBAccessor> m_DB ;
nsCOMPtr<nsNetDiskCache> m_DiskCache ;
void * tempEntry ;
PRUint32 tempEntry_length ;
nsDiskCacheRecord* m_CacheEntry ;
PRBool bReset ;
};
#endif // _NS_DBENUMERATOR_H_

View File

@@ -1,451 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#include "nsDiskCacheRecord.h"
#include "nsINetDataDiskCache.h"
#include "nsNetDiskCacheCID.h"
#include "nsDiskCacheRecordChannel.h"
#include "nsFileStream.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIProtocolHandler.h"
#include "nsIIOService.h"
#include "nsIAllocator.h"
#include "plstr.h"
#include "prprf.h"
#include "prmem.h"
#include "prlog.h"
#include "prtypes.h"
#include "netCore.h"
#include "nsDBAccessor.h"
#if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
ERROR! Must have a byte order
#endif
#ifdef IS_LITTLE_ENDIAN
#define COPY_INT32(_a,_b) memcpy(_a, _b, sizeof(int32))
#else
#define COPY_INT32(_a,_b) /* swap */ \
do { \
((char *)(_a))[0] = ((char *)(_b))[3]; \
((char *)(_a))[1] = ((char *)(_b))[2]; \
((char *)(_a))[2] = ((char *)(_b))[1]; \
((char *)(_a))[3] = ((char *)(_b))[0]; \
} while(0)
#endif
nsDiskCacheRecord::nsDiskCacheRecord(nsIDBAccessor* db, nsNetDiskCache* aCache) :
mKey(0) ,
mKeyLength(0) ,
mRecordID(0) ,
mMetaData(0) ,
mMetaDataLength(0) ,
mDB(db) ,
mInfo(0) ,
mInfoSize(0) ,
mNumChannels(0) ,
mDiskCache(aCache)
{
NS_INIT_REFCNT();
}
// mem alloced. so caller should do free() on key.
NS_IMETHODIMP
nsDiskCacheRecord::Init(const char* key, PRUint32 length)
{
NS_NewFileSpec(getter_AddRefs(mFile));
if(!mFile)
return NS_ERROR_OUT_OF_MEMORY ;
// copy key
mKeyLength = length ;
mKey = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ;
if(!mKey)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(mKey, key, length) ;
// get RecordID
// FUR!! Another disk access ? If called from GetCachedData, ID is already known
mDB->GetID(key, length, &mRecordID) ;
// FUR - check for GetID failure
// setup the file name
nsCOMPtr<nsIFileSpec> dbFolder ;
mDiskCache->GetDiskCacheFolder(getter_AddRefs(dbFolder)) ;
nsresult rv = mFile->FromFileSpec(dbFolder) ;
if(NS_FAILED(rv))
return NS_ERROR_FAILURE ;
// dir is a hash result of mRecordID%32, hope it's enough
char filename[9], dirName[3] ;
// FUR!! - should the format string be "%.02x". How does this work !?
PR_snprintf(dirName, 3, "%.2x", (((PRUint32)mRecordID) % 32)) ;
mFile->AppendRelativeUnixPath(dirName) ;
// FUR!! - should the format string be "%.08x". How does this work !?
PR_snprintf(filename, 9, "%.8x", mRecordID) ;
mFile->AppendRelativeUnixPath(filename) ;
return NS_OK ;
}
nsDiskCacheRecord::~nsDiskCacheRecord()
{
// printf(" ~nsDiskCacheRecord()\n") ;
if(mKey)
nsAllocator::Free(mKey) ;
if(mMetaData)
nsAllocator::Free(mMetaData) ;
}
//
// Implement nsISupports methods
//
NS_IMPL_ISUPPORTS(nsDiskCacheRecord, NS_GET_IID(nsINetDataCacheRecord))
///////////////////////////////////////////////////////////////////////
// nsINetDataCacheRecord methods
// yes, mem alloced on *_retval.
NS_IMETHODIMP
nsDiskCacheRecord::GetKey(PRUint32 *length, char** _retval)
{
if(!_retval)
return NS_ERROR_NULL_POINTER ;
*length = mKeyLength ;
*_retval = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ;
if(!*_retval)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(*_retval, mKey, mKeyLength) ;
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecord::GetRecordID(PRInt32* aRecordID)
{
*aRecordID = mRecordID ;
return NS_OK ;
}
// yes, mem alloced on *_retval.
NS_IMETHODIMP
nsDiskCacheRecord::GetMetaData(PRUint32 *length, char **_retval)
{
if(!_retval)
return NS_ERROR_NULL_POINTER ;
// always null the return value first.
*_retval = nsnull ;
*length = mMetaDataLength ;
if(mMetaDataLength) {
*_retval = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ;
if(!*_retval)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(*_retval, mMetaData, mMetaDataLength) ;
}
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecord::SetMetaData(PRUint32 length, const char* data)
{
// set the mMetaData
mMetaDataLength = length ;
if(mMetaData)
nsAllocator::Free(mMetaData) ;
mMetaData = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ;
if(!mMetaData) {
return NS_ERROR_OUT_OF_MEMORY ;
}
memcpy(mMetaData, data, length) ;
// Generate mInfo
nsresult rv = GenInfo() ;
if(NS_FAILED(rv))
return rv ;
// write through into mDB
rv = mDB->Put(mRecordID, mInfo, mInfoSize) ;
// FUR - mInfo leaking ?
return rv ;
}
NS_IMETHODIMP
nsDiskCacheRecord::GetStoredContentLength(PRUint32 *aStoredContentLength)
{
return mFile->GetFileSize(aStoredContentLength) ;
}
// untill nsIFileSpec::Truncate() is in, we have to do all this ugly stuff
NS_IMETHODIMP
nsDiskCacheRecord::SetStoredContentLength(PRUint32 aStoredContentLength)
{
PRUint32 len = 0 ;
nsresult rv = mFile->GetFileSize(&len) ;
if(NS_FAILED(rv))
return rv ;
if(len < aStoredContentLength)
{
NS_ERROR("Error: can not set filesize to something bigger than itself.\n") ;
return NS_ERROR_FAILURE ;
}
else
return mFile->Truncate(aStoredContentLength) ;
}
NS_IMETHODIMP
nsDiskCacheRecord::Delete(void)
{
if(mNumChannels)
return NS_ERROR_NOT_AVAILABLE ;
PRUint32 len ;
mFile->GetFileSize(&len) ;
nsFileSpec cache_file ;
nsresult rv = mFile->GetFileSpec(&cache_file) ;
if(NS_FAILED(rv))
return NS_ERROR_FAILURE ;
cache_file.Delete(PR_TRUE) ;
// updata the storage size
mDiskCache->m_StorageInUse -= len ;
rv = mDB->Del(mRecordID, mKey, mKeyLength) ;
if(NS_FAILED(rv))
return NS_ERROR_FAILURE ;
else
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecord::GetFilename(nsIFileSpec * *aFilename)
{
if(!aFilename)
return NS_ERROR_NULL_POINTER ;
*aFilename = mFile ;
NS_ADDREF(*aFilename) ;
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecord::NewChannel(nsILoadGroup *loadGroup, nsIChannel **_retval)
{
nsDiskCacheRecordChannel* channel = new nsDiskCacheRecordChannel(this, loadGroup) ;
if(!channel)
return NS_ERROR_OUT_OF_MEMORY ;
nsresult rv = channel->Init() ;
if(NS_FAILED(rv))
return rv ;
NS_ADDREF(channel) ;
*_retval = NS_STATIC_CAST(nsIChannel*, channel) ;
return NS_OK ;
}
//////////////////////////////////////////////////////////////////////////
// nsDiskCacheRecord methods
// file name is represented by a url string. I hope this would be more
// generic
nsresult
nsDiskCacheRecord::GenInfo()
{
if(mInfo)
nsAllocator::Free(mInfo) ;
char* file_url=nsnull ;
PRUint32 name_len ;
mFile->GetURLString(&file_url) ;
name_len = PL_strlen(file_url)+1 ;
mInfoSize = sizeof(PRUint32) ; // checksum for mInfoSize
mInfoSize += sizeof(PRInt32) ; // RecordID
mInfoSize += sizeof(PRUint32) ; // key length
mInfoSize += mKeyLength ; // key
mInfoSize += sizeof(PRUint32) ; // metadata length
mInfoSize += mMetaDataLength ; // metadata
mInfoSize += sizeof(PRUint32) ; // filename length
mInfoSize += name_len ; // filename
void* newInfo = nsAllocator::Alloc(mInfoSize*sizeof(char)) ;
if(!newInfo) {
return NS_ERROR_OUT_OF_MEMORY ;
}
// copy the checksum mInfoSize
char* cur_ptr = NS_STATIC_CAST(char*, newInfo) ;
COPY_INT32(cur_ptr, &mInfoSize) ;
cur_ptr += sizeof(PRUint32) ;
// copy RecordID
COPY_INT32(cur_ptr, &mRecordID) ;
cur_ptr += sizeof(PRInt32) ;
// copy key length
COPY_INT32(cur_ptr, &mKeyLength) ;
cur_ptr += sizeof(PRUint32) ;
// copy key
memcpy(cur_ptr, mKey, mKeyLength) ;
cur_ptr += mKeyLength ;
// copy metadata length
COPY_INT32(cur_ptr, &mMetaDataLength) ;
cur_ptr += sizeof(PRUint32) ;
// copy metadata
memcpy(cur_ptr, mMetaData, mMetaDataLength) ;
cur_ptr += mMetaDataLength ;
// copy file name length
COPY_INT32(cur_ptr, &name_len) ;
cur_ptr += sizeof(PRUint32) ;
// copy file name
memcpy(cur_ptr, file_url, name_len) ;
cur_ptr += name_len ;
PR_ASSERT(cur_ptr == NS_STATIC_CAST(char*, newInfo) + mInfoSize);
mInfo = newInfo ;
return NS_OK ;
}
/*
* This Method suppose to get all the info from the db record
* and set them to accroding members. the original values
* will all be overwritten. only minimal error checking is performed.
*/
NS_IMETHODIMP
nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength)
{
// reset everything
if(mInfo) {
nsAllocator::Free(mInfo) ;
mInfo = nsnull ;
}
if(mKey) {
nsAllocator::Free(mKey) ;
mKey = nsnull ;
}
if(mMetaData) {
nsAllocator::Free(mMetaData) ;
mMetaData = nsnull ;
}
char * cur_ptr = NS_STATIC_CAST(char*, aInfo) ;
char* file_url ;
PRUint32 name_len ;
// set mInfoSize
COPY_INT32(&mInfoSize, cur_ptr) ;
cur_ptr += sizeof(PRUint32) ;
// check this at least
if(mInfoSize != aInfoLength)
return NS_ERROR_FAILURE ;
// set mRecordID
COPY_INT32(&mRecordID, cur_ptr) ;
cur_ptr += sizeof(PRInt32) ;
// set mKeyLength
COPY_INT32(&mKeyLength, cur_ptr) ;
cur_ptr += sizeof(PRUint32) ;
// set mKey
mKey = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ;
if(!mKey)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(mKey, cur_ptr, mKeyLength) ;
cur_ptr += mKeyLength ;
PRInt32 id ;
mDB->GetID(mKey, mKeyLength, &id) ;
NS_ASSERTION(id==mRecordID, "\t ++++++ bad record, somethings wrong\n") ;
// set mMetaDataLength
COPY_INT32(&mMetaDataLength, cur_ptr) ;
cur_ptr += sizeof(PRUint32) ;
// set mMetaData
mMetaData = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ;
if(!mMetaData)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(mMetaData, cur_ptr, mMetaDataLength) ;
cur_ptr += mMetaDataLength ;
// get mFile name length
COPY_INT32(&name_len, cur_ptr) ;
cur_ptr += sizeof(PRUint32) ;
// get mFile native name
file_url = NS_STATIC_CAST(char*, nsAllocator::Alloc(name_len*sizeof(char))) ;
if(!file_url)
return NS_ERROR_OUT_OF_MEMORY ;
memcpy(file_url, cur_ptr, name_len) ;
cur_ptr += name_len ;
PR_ASSERT(cur_ptr == NS_STATIC_CAST(char*, aInfo) + mInfoSize);
// create mFile if Init() isn't called
if(!mFile) {
NS_NewFileSpec(getter_AddRefs(mFile));
if(!mFile)
return NS_ERROR_OUT_OF_MEMORY ;
}
// setup mFile
mFile->SetURLString(file_url) ;
return NS_OK ;
}

View File

@@ -1,70 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#ifndef _NET_CACHEDDISKDATA_H_
#define _NET_CACHEDDISKDATA_H_
#include "nsINetDataCacheRecord.h"
#include "nsCOMPtr.h"
#include "nsIDBAccessor.h"
#include "prtypes.h"
#include "nsILoadGroup.h"
#include "nsIFileChannel.h"
#include "nsNetDiskCache.h"
class nsDiskCacheRecord : public nsINetDataCacheRecord
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSINETDATACACHERECORD
protected:
nsDiskCacheRecord(nsIDBAccessor* db, nsNetDiskCache* aCache) ;
virtual ~nsDiskCacheRecord() ;
NS_IMETHOD RetrieveInfo(void* aInfo, PRUint32 aInfoLength) ;
NS_IMETHOD Init(const char* key, PRUint32 length) ;
nsresult GenInfo(void) ;
private:
char* mKey ;
PRUint32 mKeyLength ;
PRInt32 mRecordID ;
char* mMetaData ;
PRUint32 mMetaDataLength ;
nsCOMPtr<nsIFileSpec> mFile ;
nsCOMPtr<nsIDBAccessor> mDB ;
void* mInfo ;
PRUint32 mInfoSize ;
PRUint32 mNumChannels ;
nsCOMPtr<nsNetDiskCache> mDiskCache ;
friend class nsDiskCacheRecordChannel ;
friend class nsDBEnumerator ;
friend class nsNetDiskCache ;
} ;
#endif // _NET_CACHEDDISKDATA_H_

View File

@@ -1,392 +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 Mozilla Communicator.
*
* The Initial Developer of the Original Code is Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#include "nsDiskCacheRecordChannel.h"
//#include "nsFileTransport.h"
#include "nsIIOService.h"
#include "nsIServiceManager.h"
#include "nsIOutputStream.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
// This is copied from nsMemCacheChannel, We should consolidate these two.
class WriteStreamWrapper : public nsIOutputStream
{
public:
WriteStreamWrapper(nsDiskCacheRecordChannel* aChannel,
nsIOutputStream *aBaseStream) ;
virtual ~WriteStreamWrapper() ;
static nsresult
Create(nsDiskCacheRecordChannel* aChannel, nsIOutputStream *aBaseStream, nsIOutputStream* *aWrapper) ;
NS_DECL_ISUPPORTS
NS_DECL_NSIBASESTREAM
NS_DECL_NSIOUTPUTSTREAM
private:
nsDiskCacheRecordChannel* mChannel;
nsCOMPtr<nsIOutputStream> mBaseStream;
} ;
// implement nsISupports
NS_IMPL_ISUPPORTS(WriteStreamWrapper, NS_GET_IID(nsIOutputStream))
WriteStreamWrapper::WriteStreamWrapper(nsDiskCacheRecordChannel* aChannel,
nsIOutputStream *aBaseStream)
: mChannel(aChannel), mBaseStream(aBaseStream)
{
NS_INIT_REFCNT();
NS_ADDREF(mChannel);
}
WriteStreamWrapper::~WriteStreamWrapper()
{
NS_RELEASE(mChannel);
}
nsresult
WriteStreamWrapper::Create(nsDiskCacheRecordChannel*aChannel, nsIOutputStream *aBaseStream, nsIOutputStream* * aWrapper)
{
WriteStreamWrapper *wrapper = new WriteStreamWrapper(aChannel, aBaseStream);
if (!wrapper) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(wrapper);
*aWrapper = wrapper;
return NS_OK;
}
NS_IMETHODIMP
WriteStreamWrapper::Write(const char *aBuffer, PRUint32 aCount, PRUint32 *aNumWritten)
{
*aNumWritten = 0;
nsresult rv = mBaseStream->Write(aBuffer, aCount, aNumWritten);
mChannel->NotifyStorageInUse(*aNumWritten);
return rv;
}
NS_IMETHODIMP
WriteStreamWrapper::Flush()
{
return mBaseStream->Flush();
}
NS_IMETHODIMP
WriteStreamWrapper::Close()
{
return mBaseStream->Close();
}
nsDiskCacheRecordChannel::nsDiskCacheRecordChannel(nsDiskCacheRecord *aRecord,
nsILoadGroup *aLoadGroup)
: mRecord(aRecord) ,
mLoadGroup(aLoadGroup)
{
NS_INIT_REFCNT() ;
mRecord->mNumChannels++ ;
}
nsDiskCacheRecordChannel::~nsDiskCacheRecordChannel()
{
mRecord->mNumChannels-- ;
}
// FUR!!
//
// I know that I gave conflicting advice on the issue of file
// transport versus file protocol handler, but I thought that the
// last word was that we would use the raw transport, when I wrote:
//
// > I just thought of an argument for the other side of the coin, i.e. the
// > benefit of *not* reusing the file protocol handler: On the Mac, it's
// > expensive to convert from a string URL to an nsFileSpec, because the Mac
// > is brain-dead and scans every directory on the path to the file. It's
// > cheaper to create a nsFileSpec for a cache file by combining a single,
// > static nsFileSpec that corresponds to the cache directory with the
// > relative path to the cache file (using nsFileSpec's operator +). This
// > operation is optimized on the Mac to avoid the scanning operation.
//
// The Mac guys will eat us alive if we do path string to nsFileSpec
// conversions for every cache file we open.
nsresult
nsDiskCacheRecordChannel::Init(void)
{
char* urlStr ;
mRecord->mFile->GetURLString(&urlStr) ;
nsresult rv ;
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = serv->NewChannel("load", // XXX what should this be?
urlStr,
nsnull, // no base uri
mLoadGroup,
nsnull, // no eventsink getter
0,
nsnull, // no original URI
0,
0,
getter_AddRefs(mFileTransport));
return rv ;
}
nsresult
nsDiskCacheRecordChannel::NotifyStorageInUse(PRInt32 aBytesUsed)
{
return mRecord->mDiskCache->m_StorageInUse += aBytesUsed ;
}
// implement nsISupports
NS_IMPL_ISUPPORTS(nsDiskCacheRecordChannel, NS_GET_IID(nsIChannel))
// implement nsIRequest
NS_IMETHODIMP
nsDiskCacheRecordChannel::IsPending(PRBool *aIsPending)
{
*aIsPending = PR_FALSE ;
if(!mFileTransport)
return NS_OK ;
return mFileTransport->IsPending(aIsPending) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::Cancel(void)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->Cancel() ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::Suspend(void)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->Suspend() ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::Resume(void)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->Resume() ;
}
// implement nsIChannel
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetURI(nsIURI * *aURI)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->GetURI(aURI) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::OpenInputStream(PRUint32 aStartPosition,
PRInt32 aReadCount,
nsIInputStream* *aResult)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->OpenInputStream(aStartPosition,
aReadCount,
aResult) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::OpenOutputStream(PRUint32 startPosition,
nsIOutputStream* *aResult)
{
nsresult rv ;
NS_ENSURE_ARG(aResult) ;
nsCOMPtr<nsIOutputStream> outputStream ;
PRUint32 oldLength ;
mRecord->GetStoredContentLength(&oldLength) ;
if(startPosition < oldLength) {
NotifyStorageInUse(startPosition - oldLength) ;
// we should truncate the file at here.
rv = mRecord->SetStoredContentLength(startPosition) ;
if(NS_FAILED(rv)) {
printf(" failed to truncate\n") ;
return rv ;
}
}
rv = mFileTransport->OpenOutputStream(startPosition, getter_AddRefs(outputStream)) ;
if(NS_FAILED(rv)) return rv ;
return WriteStreamWrapper::Create(this, outputStream, aResult) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::AsyncOpen(nsIStreamObserver *observer,
nsISupports *ctxt)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->AsyncOpen(observer, ctxt) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::AsyncRead(PRUint32 aStartPosition,
PRInt32 aReadCount,
nsISupports *aContext,
nsIStreamListener *aListener)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->AsyncRead(aStartPosition ,
aReadCount ,
aContext ,
aListener) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::AsyncWrite(nsIInputStream *fromStream,
PRUint32 startPosition,
PRInt32 writeCount,
nsISupports *ctxt,
nsIStreamObserver *observer)
{
/*
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->AsyncWrite(fromStream,
startPosition,
writeCount,
ctxt,
observer) ;
*/
// I can't do this since the write is not monitored, and I won't be
// able to updata the storage.
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->GetLoadAttributes(aLoadAttributes) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->SetLoadAttributes(aLoadAttributes) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetContentType(char * *aContentType)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->GetContentType(aContentType) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetContentLength(PRInt32 *aContentLength)
{
if(!mFileTransport)
return NS_ERROR_FAILURE ;
return mFileTransport->GetContentLength(aContentLength) ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetOwner(nsISupports* *aOwner)
{
*aOwner = mOwner.get() ;
NS_IF_ADDREF(*aOwner) ;
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::SetOwner(nsISupports* aOwner)
{
mOwner = aOwner ;
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetOriginalURI(nsIURI* *aURI)
{
// FUR - might need to implement this - not sure
return NS_ERROR_NOT_IMPLEMENTED ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsDiskCacheRecordChannel method unexpectedly called");
return NS_OK ;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsDiskCacheRecordChannel method unexpectedly called");
return NS_OK;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetNotificationCallbacks(nsIInterfaceRequestor* *aNotificationCallbacks)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsDiskCacheRecordChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsDiskCacheRecordChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -1,65 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#ifndef _ns_DiskCacheRecordChannel_h_
#define _ns_DiskCacheRecordChannel_h_
#include "nsIChannel.h"
#include "nsCOMPtr.h"
#include "nsDiskCacheRecord.h"
/*
* This class is plagiarized from nsMemCacheChannel
*/
class nsDiskCacheRecordChannel : public nsIChannel
{
public:
nsDiskCacheRecordChannel(nsDiskCacheRecord *aRecord, nsILoadGroup *aLoadGroup);
virtual ~nsDiskCacheRecordChannel() ;
// Declare nsISupports methods
NS_DECL_ISUPPORTS
// Declare nsIRequest methods
NS_DECL_NSIREQUEST
// Declare nsIChannel methods
NS_DECL_NSICHANNEL
nsresult Init(void) ;
private:
nsresult NotifyStorageInUse(PRInt32 aBytesUsed) ;
nsCOMPtr<nsDiskCacheRecord> mRecord ;
nsCOMPtr<nsILoadGroup> mLoadGroup ;
nsCOMPtr<nsISupports> mOwner ;
nsCOMPtr<nsIChannel> mFileTransport ;
friend class WriteStreamWrapper ;
} ;
#endif // _ns_DiskCacheRecordChannel_h_

View File

@@ -1,60 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#ifndef _NS_IDBACCESSOR_H_
#define _NS_IDBACCESSOR_H_
#include "nsISupports.h"
#include "nsIFileSpec.h"
// nsIDBAccessorIID {6AADD4D0-7785-11d3-87FE-000629D01344}
#define NS_IDBACCESSOR_IID \
{ 0x6aadd4d0, 0x7785, 0x11d3, \
{0x87, 0xfe, 0x0, 0x6, 0x29, 0xd0, 0x13, 0x44}}
// nsDBAccessorCID {6AADD4D1-7785-11d3-87FE-000629D01344}
#define NS_DBACCESSOR_CID \
{ 0x6aadd4d1, 0x7785, 0x11d3, \
{ 0x87, 0xfe, 0x0, 0x6, 0x29, 0xd0, 0x13, 0x44 }}
class nsIDBAccessor : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDBACCESSOR_IID)
NS_IMETHOD Init(nsIFileSpec* DBFile) = 0 ;
NS_IMETHOD Shutdown(void) = 0 ;
NS_IMETHOD Put(PRInt32 aID, void* anEntry, PRUint32 aLength) = 0 ;
NS_IMETHOD Get(PRInt32 aID, void** anEntry, PRUint32 *aLength) = 0 ;
NS_IMETHOD Del(PRInt32 aID, void* anEntry, PRUint32 aLength) = 0 ;
NS_IMETHOD GetID(const char* key, PRUint32 length, PRInt32* aID) = 0 ;
NS_IMETHOD EnumEntry(void* *anEntry, PRUint32* aLength, PRBool bReset) = 0 ;
} ;
#endif // _NS_IDBACCESSOR_H_

View File

@@ -1,691 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#include "nsNetDiskCache.h"
#include "nscore.h"
#include "plstr.h"
#include "prprf.h"
#include "prtypes.h"
#include "prio.h"
#include "prsystem.h" // Directory Seperator
#include "plhash.h"
#include "prclist.h"
#include "prmem.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
#include "mcom_db.h"
#include "nsDBEnumerator.h"
#include "nsDiskCacheRecord.h"
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID) ;
static NS_DEFINE_CID(kDBAccessorCID, NS_DBACCESSOR_CID) ;
static const PRUint32 DISK_CACHE_SIZE_DEFAULT = 5*1024*1024 ; // 5MB
static const char * const DISK_CACHE_PREF = "browser.cache.disk_cache_size";
static const char * const CACHE_DIR_PREF = "browser.cache.directory";
class nsDiskCacheRecord ;
nsNetDiskCache::nsNetDiskCache() :
m_Enabled(PR_TRUE) ,
m_NumEntries(0) ,
m_pNextCache(0) ,
m_pDiskCacheFolder(0) ,
m_StorageInUse(0) ,
m_DB(0) ,
m_BaseDirNum(32)
{
// set it to INF for now
m_MaxEntries = (PRUint32)-1 ;
NS_INIT_REFCNT();
}
nsNetDiskCache::~nsNetDiskCache()
{
printf("~nsNetDiskCache\n") ;
NS_IF_RELEASE(m_DB) ;
// FUR!!
// You shouldn't rely on the value of m_BaseDirNum to diagnose whether or not
// a cache corruption has occurred since it's possible that the app does not
// shut down cleanly and a corrupted cache has still not been cleaned up from
// a previous session. My suggestion is that you pick a different scheme for
// renaming the dirs, e.g. rename them as "trash*" and remove all directories
// with this name pattern on shutdown.
// FUR
// I think that, eventually, we also want a distinguished key in the DB which
// means "clean cache shutdown". You clear this flag when the db is first
// opened and set it just before the db is closed. If the db wasn't shutdown
// cleanly in a prior session, i.e. because the app crashed, on startup you
// scan all the individual files in directories and look for "orphans",
// i.e. cache files which don't have corresponding entries in the db. That's
// also when storage-in-use and number of entries would be recomputed.
//
// We don't necessarily need all this functionality immediately, though.
if(m_BaseDirNum > 32)
RemoveDirs(32) ;
}
NS_IMETHODIMP
nsNetDiskCache::Init(void)
{
nsresult rv ;
// FUR!!
// I really don't think prefs belong here, since that breaks modularity. It
// presupposes that the file cache code is embedded in the browser or some
// other application that uses the prefs, i.e. the code might be used in a
// standalone cache manipulation tool or, someday, in server code. Pref
// reading belongs at a higher level, either in the application itself or
// possibly the I/O manager.
// Also, Init() needs to be lazy, since folder name is not set on startup,
// i.e. need a call to MaybeInit() at the beginning of every public method
NS_WITH_SERVICE(nsIPref, pref, kPrefCID, &rv) ;
if (NS_FAILED(rv))
NS_ERROR("Failed to get globle preference!\n") ;
rv = NS_NewFileSpec(getter_AddRefs(m_pDiskCacheFolder));
if (!m_pDiskCacheFolder) {
NS_ERROR("ERROR: Could not make a file spec.\n") ;
return NS_ERROR_OUT_OF_MEMORY ;
}
char* tempPref = 0 ;
if(pref) {
PRInt32 nTemp = 0 ;
/*
rv = pref->CopyCharPref(CACHE_DIR_PREF, &tempPref) ;
if (NS_SUCCEEDED(rv)) {
printf("cache dir is %s\n", tempPref) ;
m_pDiskCacheFolder->SetUnixStyleFilePath(tempPref) ;
PR_Free(tempPref) ;
} else */
{
m_pDiskCacheFolder->SetUnixStyleFilePath("/tmp") ;
printf("using default folder, /tmp\n") ;
}
}
else {
// temp hack for now. change later for other platform
m_pDiskCacheFolder->SetUnixStyleFilePath("/tmp") ;
}
// FUR - suggest you use nsCOMPtr for m_DB - it will eliminate
// manual addref/release and reduce likelihood of bugs
NS_IF_RELEASE(m_DB) ;
m_DB = new nsDBAccessor() ;
if(!m_DB)
return NS_ERROR_OUT_OF_MEMORY ;
else
NS_ADDREF(m_DB) ;
rv = InitDB() ;
// try once for recovery
if(rv == NS_ERROR_FAILURE) {
rv = DBRecovery() ;
return rv ;
}
rv = UpdateInfo() ;
return rv ;
}
NS_IMETHODIMP
nsNetDiskCache::InitDB(void)
{
// create cache sub directories
nsresult rv ;
nsCOMPtr<nsIFileSpec> cacheSubDir;
rv = NS_NewFileSpec(getter_AddRefs(cacheSubDir));
// FUR - any way to avoid doing this, if it's already been done ?
for (int i=0; i < 32; i++) {
rv = cacheSubDir->FromFileSpec(m_pDiskCacheFolder) ;
if(NS_FAILED(rv))
return rv ;
char dirName[3];
PR_snprintf (dirName, 3, "%0.2x", i);
cacheSubDir->AppendRelativeUnixPath (dirName) ;
CreateDir(cacheSubDir);
}
NS_NewFileSpec(getter_AddRefs(m_DBFile)) ;
// FUR - check for NS_NewFileSpec failure
rv = m_DBFile->FromFileSpec(m_pDiskCacheFolder) ;
if(NS_FAILED(rv))
return rv ;
m_DBFile->AppendRelativeUnixPath("cache.db") ;
rv = m_DB->Init(m_DBFile) ;
return rv ;
}
//////////////////////////////////////////////////////////////////////////
// nsISupports methods
// FUR - Suggest you use NS_IMPL_ISUPPORTS3() macro instead
NS_IMETHODIMP
nsNetDiskCache::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_ASSERTION(aInstancePtr, "no instance pointer");
if(aIID.Equals(NS_GET_IID(nsINetDataDiskCache)) ||
aIID.Equals(NS_GET_IID(nsINetDataCache)) ||
aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = NS_STATIC_CAST(nsINetDataDiskCache*, this);
NS_ADDREF_THIS();
return NS_OK;
}
else
return NS_NOINTERFACE ;
}
NS_IMPL_ADDREF(nsNetDiskCache) ;
NS_IMPL_RELEASE(nsNetDiskCache) ;
///////////////////////////////////////////////////////////////////////////
// nsINetDataCache Method
NS_IMETHODIMP
nsNetDiskCache::GetDescription(PRUnichar* *aDescription)
{
nsAutoString description("Disk Cache") ;
*aDescription = description.ToNewUnicode() ;
if(!*aDescription)
return NS_ERROR_OUT_OF_MEMORY ;
return NS_OK ;
}
/* don't alloc mem for nsICachedNetData.
* RecordID is generated using the same scheme in nsCacheDiskData,
* see GetCachedNetData() for detail.
*/
NS_IMETHODIMP
nsNetDiskCache::Contains(const char* key, PRUint32 length, PRBool *_retval)
{
*_retval = PR_FALSE ;
NS_ASSERTION(m_DB, "no db.") ;
PRInt32 id = 0 ;
m_DB->GetID(key, length, &id) ;
// FUR - Check for GetID failure ?
void* info = 0 ;
PRUint32 info_size = 0 ;
nsresult rv = m_DB->Get(id, &info, &info_size) ;
if(NS_SUCCEEDED(rv) && info)
*_retval = PR_TRUE ;
return NS_OK ;
}
/* regardless if it's cached or not, a copy of nsNetDiskCache would
* always be returned. so release it appropriately.
* if mem alloced, updata m_NumEntries also.
* for now, the new nsCachedNetData is not written into db yet since
* we have nothing to write.
*/
NS_IMETHODIMP
nsNetDiskCache::GetCachedNetData(const char* key, PRUint32 length, nsINetDataCacheRecord **_retval)
{
NS_ASSERTION(m_DB, "no db.") ;
nsresult rv = 0 ;
if (!_retval)
return NS_ERROR_NULL_POINTER ;
*_retval = nsnull ;
PRInt32 id = 0 ;
m_DB->GetID(key, length, &id) ;
// FUR - Check for GetID failure ?
// construct an empty record
nsDiskCacheRecord* newRecord = new nsDiskCacheRecord(m_DB, this) ;
if(!newRecord)
return NS_ERROR_OUT_OF_MEMORY ;
rv = newRecord->Init(key, length) ;
if(NS_FAILED(rv)) {
delete newRecord ;
return rv ;
}
NS_ADDREF(newRecord) ; // addref for _retval
*_retval = (nsINetDataCacheRecord*) newRecord ;
void* info = 0 ;
PRUint32 info_size = 0 ;
rv = m_DB->Get(id, &info, &info_size) ;
if(NS_SUCCEEDED(rv) && info) {
nsresult r1 ;
r1 = newRecord->RetrieveInfo(info, info_size) ;
// FUR!! need to release and return error if RetrieveInfo() fails
if(NS_SUCCEEDED(rv))
return NS_OK ;
else
return r1;
} else if (NS_SUCCEEDED(rv) && !info) {
// this is a new record.
m_NumEntries ++ ;
return NS_OK ;
} else
return rv ;
}
/* get an nsICachedNetData, mem needs to be de-alloced if not found. */
NS_IMETHODIMP
nsNetDiskCache::GetCachedNetDataByID(PRInt32 RecordID, nsINetDataCacheRecord **_retval)
{
NS_ASSERTION(m_DB, "no db.") ;
if (!_retval)
return NS_ERROR_NULL_POINTER ;
*_retval = nsnull ;
nsresult rv ;
void* info = 0 ;
PRUint32 info_size = 0 ;
rv = m_DB->Get(RecordID, &info, &info_size) ;
if(NS_SUCCEEDED(rv) && info) {
// construct an empty record if only found in db
nsDiskCacheRecord* newRecord = new nsDiskCacheRecord(m_DB, this) ;
if(!newRecord)
return NS_ERROR_OUT_OF_MEMORY ;
NS_ADDREF(newRecord) ; // addref for _retval
rv = newRecord->RetrieveInfo(info, info_size) ;
if(NS_SUCCEEDED(rv)) {
*_retval = (nsINetDataCacheRecord*) newRecord ;
return NS_OK ;
}
else {
// bad record, I guess
NS_RELEASE(newRecord) ; // release if bad things happen
return rv ;
}
} else {
NS_ERROR("Error: RecordID not in DB\n") ;
return rv ;
}
}
NS_IMETHODIMP
nsNetDiskCache::GetEnabled(PRBool *aEnabled)
{
*aEnabled = m_Enabled ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::SetEnabled(PRBool aEnabled)
{
m_Enabled = aEnabled ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::GetFlags(PRUint32 *aFlags)
{
*aFlags = FILE_PER_URL_CACHE;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::GetNumEntries(PRUint32 *aNumEntries)
{
*aNumEntries = m_NumEntries ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::GetMaxEntries(PRUint32 *aMaxEntries)
{
*aMaxEntries = m_MaxEntries ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::NewCacheEntryIterator(nsISimpleEnumerator **_retval)
{
if(!_retval)
return NS_ERROR_NULL_POINTER ;
*_retval = nsnull ;
nsISimpleEnumerator* enumerator = new nsDBEnumerator(m_DB, this) ;
if(enumerator) {
NS_ADDREF(enumerator) ;
*_retval = enumerator ;
return NS_OK ;
}
else
return NS_ERROR_OUT_OF_MEMORY ;
}
NS_IMETHODIMP
nsNetDiskCache::GetNextCache(nsINetDataCache * *aNextCache)
{
if(!aNextCache)
return NS_ERROR_NULL_POINTER ;
*aNextCache = m_pNextCache ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::SetNextCache(nsINetDataCache *aNextCache)
{
m_pNextCache = aNextCache ;
return NS_OK ;
}
// db size can always be measured at the last minute. Since it's hard
// to know before hand.
NS_IMETHODIMP
nsNetDiskCache::GetStorageInUse(PRUint32 *aStorageInUse)
{
PRUint32 total_size = m_StorageInUse, len = 0 ;
// FUR!!
// GetStorageInUse() can be called hundreds of times per second, i.e. every
// time a buffer of data is written to the cache, so we can't afford to stat
// the db file on every call. I would suggest caching the size of the db and
// invalidating that cached value every time a record is written to the db,
// or even every ten written records.
// add the size of the db.
// m_DBFile->GetFileSize(&len) ;
// total_size += len ;
// we need size in kB
total_size = total_size >> 10 ;
*aStorageInUse = total_size ;
return NS_OK ;
}
/*
* The whole cache dirs can be whiped clean since all the cache
* files are resides in seperate hashed dirs. It's safe to do so.
*/
NS_IMETHODIMP
nsNetDiskCache::RemoveAll(void)
{
nsresult rv = RemoveDirs(0) ;
if(NS_FAILED(rv))
return rv ;
// don't forget the db file itself
m_DB->Shutdown() ;
nsFileSpec dbfile ;
m_DBFile->GetFileSpec(&dbfile) ;
dbfile.Delete(PR_TRUE) ;
// reinitilize
rv = InitDB() ;
if(NS_FAILED(rv))
return rv ;
rv = UpdateInfo() ;
return rv ;
}
//////////////////////////////////////////////////////////////////
// nsINetDataDiskCache methods
NS_IMETHODIMP
nsNetDiskCache::GetDiskCacheFolder(nsIFileSpec * *aDiskCacheFolder)
{
*aDiskCacheFolder = m_pDiskCacheFolder ;
NS_ADDREF(*aDiskCacheFolder) ;
return NS_OK ;
}
NS_IMETHODIMP
nsNetDiskCache::SetDiskCacheFolder(nsIFileSpec * aDiskCacheFolder)
{
char *newfolder, *oldfolder ;
m_pDiskCacheFolder->GetNativePath(&oldfolder) ;
aDiskCacheFolder->GetNativePath(&newfolder) ;
if(PL_strcmp(newfolder, oldfolder) == 0) {
m_pDiskCacheFolder = aDiskCacheFolder ;
// should we do this?
// FUR - no
nsresult rv = RemoveAll() ;
return rv ;
}
else
// FUR
// Need to blow away old cache, build new one
return NS_OK ;
}
//////////////////////////////////////////////////////////////////
// nsNetDiskCache methods
// create a directory (recursively)
NS_IMETHODIMP
nsNetDiskCache::CreateDir(nsIFileSpec* dir_spec)
{
PRBool does_exist ;
nsCOMPtr<nsIFileSpec> p_spec ;
dir_spec->Exists(&does_exist) ;
if(does_exist)
return NS_OK ;
dir_spec->GetParent(getter_AddRefs(p_spec)) ;
// FUR - check return value
p_spec->Exists(&does_exist) ;
if(!does_exist) {
CreateDir(p_spec) ;
dir_spec->CreateDir() ;
// FUR - check return value
}
else {
dir_spec->CreateDir() ;
// FUR - check return value
}
return NS_OK ;
}
// FUR!!
// We can't afford to make a *separate* pass over the whole db on every
// startup, just to figure out m_NumEntries and m_StorageInUse. (This is a
// several second operation on a large db). We'll likely need to store
// distinguished keys in the db that contain these values and update them
// incrementally, except when failure to shut down the db cleanly is detected.
// this will walk through db and update m_NumEntries and m_StorageInUse
NS_IMETHODIMP
nsNetDiskCache::UpdateInfo(void)
{
// count num of entries in db
// NS_ADDREF(this) ; // addref before assign to a nsCOMPtr.
nsISimpleEnumerator* dbEnumerator = new nsDBEnumerator(m_DB, this) ;
if(dbEnumerator)
NS_ADDREF(dbEnumerator) ;
else
return NS_ERROR_FAILURE ;
PRUint32 numEntries = 0, storageInUse = 0, len = 0 ;
PRBool more = PR_FALSE ;
do {
dbEnumerator->HasMoreElements(&more) ;
if(more) {
// update entry number
numEntries++ ;
// update storage in use
nsINetDataCacheRecord* record ;
dbEnumerator->GetNext((nsISupports**)&record) ;
record->GetStoredContentLength(&len) ;
storageInUse += len ;
NS_IF_RELEASE(record) ;
}
} while (more) ;
NS_IF_RELEASE(dbEnumerator) ;
m_NumEntries = numEntries ;
m_StorageInUse = storageInUse ;
printf(" m_NumEntries = %d, size is %d.\n", m_NumEntries, m_StorageInUse) ;
return NS_OK ;
}
// this routine will add m_BaseDirNum to current CacheSubDir names.
// e.g. 00->20, 1f->5f. and update the m_BaseDirNum to another 32.
// the idea is as long as we remember the base number,
// we know how many dirs needs to be removed during shutdown period
// it will be from 0x20 to m_BaseDirNum.
// also, we assume that this operation will not be performed 3 times more
// within a single session. it is part of scavenging routine.
NS_IMETHODIMP
nsNetDiskCache::RenameCacheSubDirs(void)
{
nsCOMPtr<nsIFileSpec> cacheSubDir;
nsresult rv = NS_NewFileSpec(getter_AddRefs(cacheSubDir)) ;
for (int i=0; i < 32; i++) {
rv = cacheSubDir->FromFileSpec(m_pDiskCacheFolder) ;
if(NS_FAILED(rv))
return rv ;
char dirName[3];
PR_snprintf(dirName, 3, "%0.2x", i) ;
cacheSubDir->AppendRelativeUnixPath(dirName) ;
// re-name the directory
PR_snprintf(dirName, 3, "%0.2x", i+m_BaseDirNum) ;
rv = cacheSubDir->Rename(dirName) ;
if(NS_FAILED(rv))
return NS_ERROR_FAILURE ;
}
// update m_BaseDirNum
m_BaseDirNum += 32 ;
return NS_OK ;
}
// this routine will be called everytime we have a db corruption.
NS_IMETHODIMP
nsNetDiskCache::DBRecovery(void)
{
nsresult rv = RenameCacheSubDirs() ;
if(NS_FAILED(rv))
return rv ;
// remove corrupted db file
rv = m_DB->Shutdown() ;
// FUR!!
// You shouldn't return if this fails. Otherwise, it might prevent db deletion
if(NS_FAILED(rv))
return rv ;
nsFileSpec dbfile ;
m_DBFile->GetFileSpec(&dbfile) ;
dbfile.Delete(PR_TRUE) ;
// make sure it's not there any more
PRBool exists = dbfile.Exists() ;
if(exists) {
NS_ERROR("can't remove old db.") ;
return NS_ERROR_FAILURE ;
}
// reinitilize
rv = InitDB() ;
if(NS_FAILED(rv))
return rv ;
rv = UpdateInfo() ;
return rv ;
}
// this routine is used by dtor and RemoveAll() to clean up dirs.
// All directory named from aNum - m_BasedDirNum will be deleted.
NS_IMETHODIMP
nsNetDiskCache::RemoveDirs(PRUint32 aNum)
{
nsCOMPtr<nsIFileSpec> cacheSubDir;
nsresult rv = NS_NewFileSpec(getter_AddRefs(cacheSubDir));
if(NS_FAILED(rv))
return NS_ERROR_FAILURE ;
for (int i=aNum; i < m_BaseDirNum; i++) {
cacheSubDir->FromFileSpec(m_pDiskCacheFolder) ;
char dirName[3];
PR_snprintf (dirName, 3, "%0.2x", i);
cacheSubDir->AppendRelativeUnixPath (dirName) ;
nsFileSpec subdir ;
cacheSubDir->GetFileSpec(&subdir) ;
for(nsDirectoryIterator di(subdir, PR_FALSE); di.Exists(); di++) {
di.Spec().Delete(PR_TRUE) ;
}
subdir.Delete(PR_FALSE) ; // recursive delete
}
return NS_OK ;
}

View File

@@ -1,82 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
// FUR - Add overall description comment here
#ifndef __gen_nsNetDiskCache_h__
#define __gen_nsNetDiskCache_h__
#include "nsINetDataDiskCache.h"
#include "nsNetDiskCacheCID.h"
#include "nsCOMPtr.h"
#include "nsIPref.h"
#include "nsDBAccessor.h"
class nsIURI; /* forward decl */
class nsICachedNetData; /* forward decl */
class nsISimpleEnumerator; /* forward decl */
class nsIFileSpec; /* forward decl */
/* starting interface: nsNetDiskCache */
class nsNetDiskCache : public nsINetDataDiskCache {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSINETDATACACHE
NS_DECL_NSINETDATADISKCACHE
NS_IMETHOD Init(void) ;
nsNetDiskCache() ;
virtual ~nsNetDiskCache() ;
protected:
NS_IMETHOD InitDB(void) ;
NS_IMETHOD CreateDir(nsIFileSpec* dir_spec) ;
NS_IMETHOD UpdateInfo(void) ;
NS_IMETHOD RenameCacheSubDirs(void) ;
NS_IMETHOD DBRecovery(void) ;
NS_IMETHOD RemoveDirs(PRUint32 aNum) ;
private:
PRBool m_Enabled ;
PRUint32 m_NumEntries ;
nsCOMPtr<nsINetDataCache> m_pNextCache ;
nsCOMPtr<nsIFileSpec> m_pDiskCacheFolder ;
nsCOMPtr<nsIFileSpec> m_DBFile ;
PRUint32 m_MaxEntries ;
PRUint32 m_StorageInUse ;
nsIDBAccessor* m_DB ;
// this is used to indicate a db corruption
PRInt32 m_BaseDirNum ;
friend class nsDiskCacheRecord ;
friend class nsDiskCacheRecordChannel ;
} ;
#endif /* __gen_nsNetDiskCache_h__ */

View File

@@ -1,32 +0,0 @@
/*
* 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 Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
#ifndef _nsNetDiskCacheCID_h_
#define _nsNetDiskCacheCID_h_
#define NS_NETDISKCACHE_CID_STR "ECFEEA00-7201-11d3-87FE-000629D01344"
#define NS_NETDISKCACHE_CID \
{ 0xecfeea00, 0x7201, 0x11d3, \
{ 0x87, 0xfe, 0x0, 0x6, 0x29, 0xd0, 0x13, 0x44 }}
#endif /* _nsNetDiskCacheCID_h_ */

View File

@@ -1,50 +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
REQUIRES = libreg xpcom
CPPSRCS = \
diskcache.cpp \
$(NULL)
SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
ifdef NO_LD_ARCHIVE_FLAGS
LOST_SYM_LIBS = -lxpcomds_s -lxptinfo -lmozreg_s
endif
LIBS = \
-lmozjs \
-lxpcom \
-lmozdbm_s \
$(MOZ_NECKO_UTIL_LIBS) \
$(LOST_SYM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = -I$(srcdir)/..
DEFINES += -DUSE_NSREG -DCACHE

View File

@@ -1,836 +0,0 @@
/* -*- Mode: C++; tab-width: 2; 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 "nsIStreamListener.h"
#include "nsIStreamObserver.h"
#include "nsIServiceManager.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsIEventQueue.h"
#include "nsIEventQueueService.h"
#include "nsIChannel.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include <stdio.h>
#include <unistd.h>
#include "nsINetDataCache.h"
#include "nsINetDataCacheRecord.h"
//#include "nsMemCacheCID.h"
#include "nsNetDiskCache.h"
#include "nsIPref.h"
#include "prenv.h"
#include "nsIFileStream.h"
// Number of test entries to be placed in the cache
#define NUM_CACHE_ENTRIES 250
// Cache content stream length will have random length between zero and
// MAX_CONTENT_LENGTH bytes
#define MAX_CONTENT_LENGTH 20000
// Length of random-data cache entry key
#define CACHE_KEY_LENGTH 15
// Length of random-data cache entry meta-data
#define CACHE_METADATA_LENGTH 100
//static NS_DEFINE_CID(kMemCacheCID, NS_MEM_CACHE_FACTORY_CID);
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kDiskCacheCID, NS_NETDISKCACHE_CID) ;
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID);
// Mapping from test case number to RecordID
static PRInt32 recordID[NUM_CACHE_ENTRIES];
static PRInt32
mapRecordIdToTestNum(PRInt32 aRecordID)
{
int i;
for (i = 0; i < NUM_CACHE_ENTRIES; i++) {
if (recordID[i] == aRecordID)
return i;
}
return -1;
}
// A supply of stream data to either store or compare with
class nsITestDataStream {
public:
virtual ~nsITestDataStream() {};
virtual PRUint32 Next() = 0;
virtual void Read(char* aBuf, PRUint32 aCount) = 0;
virtual PRBool Match(char* aBuf, PRUint32 aCount) = 0;
virtual void Skip(PRUint32 aCount) = 0;
};
// A reproducible stream of random data.
class RandomStream : public nsITestDataStream {
public:
RandomStream(PRUint32 aSeed) {
mStartSeed = mState = aSeed;
}
PRUint32 GetStartSeed() {
return mStartSeed;
}
PRUint32 Next() {
mState = 1103515245 * mState + 12345;
return mState;
}
void Read(char* aBuf, PRUint32 aCount) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
*aBuf++ = Next();
}
}
PRBool
Match(char* aBuf, PRUint32 aCount) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
if (*aBuf++ != (char)(Next() & 0xff))
return PR_FALSE;
}
return PR_TRUE;
}
void
Skip(PRUint32 aCount) {
while (aCount--)
Next();
}
protected:
PRUint32 mState;
PRUint32 mStartSeed;
};
// A stream of data that increments on each byte that is read, modulo 256
class CounterStream : public nsITestDataStream {
public:
CounterStream(PRUint32 aSeed) {
mStartSeed = mState = aSeed;
}
PRUint32 GetStartSeed() {
return mStartSeed;
}
PRUint32 Next() {
mState += 1;
mState &= 0xff;
return mState;
}
void Read(char* aBuf, PRUint32 aCount) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
*aBuf++ = Next();
}
}
PRBool
Match(char* aBuf, PRUint32 aCount) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
if (*aBuf++ != (char)Next())
return PR_FALSE;
}
return PR_TRUE;
}
void
Skip(PRUint32 aCount) {
mState += aCount;
mState &= 0xff;
}
protected:
PRUint32 mState;
PRUint32 mStartSeed;
};
static int gNumReaders = 0;
static PRUint32 gTotalBytesRead = 0;
static PRUint32 gTotalDuration = 0;
class nsReader : public nsIStreamListener {
public:
NS_DECL_ISUPPORTS
nsReader()
: mStartTime(0), mBytesRead(0)
{
NS_INIT_REFCNT();
gNumReaders++;
}
virtual ~nsReader() {
delete mTestDataStream;
gNumReaders--;
}
nsresult
Init(nsIChannel *aChannel, nsITestDataStream* aRandomStream, PRUint32 aExpectedStreamLength) {
mChannel = aChannel;
mTestDataStream = aRandomStream;
mExpectedStreamLength = aExpectedStreamLength;
mRefCnt = 1;
return NS_OK;
}
NS_IMETHOD OnStartRequest(nsIChannel* channel,
nsISupports* context) {
mStartTime = PR_IntervalNow();
return NS_OK;
}
NS_IMETHOD OnDataAvailable(nsIChannel* channel,
nsISupports* context,
nsIInputStream *aIStream,
PRUint32 aSourceOffset,
PRUint32 aLength) {
char buf[1025];
while (aLength > 0) {
PRUint32 amt;
PRBool match;
aIStream->Read(buf, sizeof buf, &amt);
if (amt == 0) break;
aLength -= amt;
mBytesRead += amt;
match = mTestDataStream->Match(buf, amt);
NS_ASSERTION(match, "Stored data was corrupted on read");
}
return NS_OK;
}
NS_IMETHOD OnStopRequest(nsIChannel* channel,
nsISupports* context,
nsresult aStatus,
const PRUnichar* aMsg) {
PRIntervalTime endTime;
PRIntervalTime duration;
endTime = PR_IntervalNow();
duration = (endTime - mStartTime);
if (NS_FAILED(aStatus)) printf("channel failed.\n");
// printf("read %d bytes\n", mBytesRead);
NS_ASSERTION(mBytesRead == mExpectedStreamLength,
"Stream in cache is wrong length");
gTotalBytesRead += mBytesRead;
gTotalDuration += duration;
// Release channel
mChannel = 0;
return NS_OK;
}
protected:
PRIntervalTime mStartTime;
PRUint32 mBytesRead;
nsITestDataStream* mTestDataStream;
PRUint32 mExpectedStreamLength;
nsCOMPtr<nsIChannel> mChannel;
};
NS_IMPL_ISUPPORTS2(nsReader, nsIStreamListener, nsIStreamObserver)
static nsIEventQueue* eventQueue;
nsresult
InitQueue() {
nsresult rv;
NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue service");
rv = eventQService->CreateThreadEventQueue();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create event queue");
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQueue);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue for main thread");
return NS_OK;
}
// Process events until all streams are OnStopRequest'ed
nsresult
WaitForEvents() {
while (gNumReaders) {
eventQueue->ProcessPendingEvents();
}
return NS_OK;
}
// Read data for a single cache record and compare against testDataStream
nsresult
TestReadStream(nsINetDataCacheRecord *record, nsITestDataStream *testDataStream,
PRUint32 expectedStreamLength)
{
nsCOMPtr<nsIChannel> channel;
nsresult rv;
PRUint32 actualContentLength;
rv = record->NewChannel(0, getter_AddRefs(channel));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
rv = record->GetStoredContentLength(&actualContentLength);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(actualContentLength == expectedStreamLength,
"nsINetDataCacheRecord::GetContentLength() busted ?");
nsReader *reader = new nsReader;
reader->AddRef();
rv = reader->Init(channel, testDataStream, expectedStreamLength);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
rv = channel->AsyncRead(0, -1, 0, reader);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
reader->Release();
return NS_OK;
}
// Check that records can be retrieved using their record-ID, in addition
// to using the opaque key.
nsresult
TestRecordID(nsINetDataCache *cache)
{
nsresult rv;
nsCOMPtr<nsINetDataCacheRecord> record;
RandomStream *randomStream;
PRUint32 metaDataLength;
char cacheKey[CACHE_KEY_LENGTH];
char *metaData;
PRUint32 testNum;
PRBool match;
for (testNum = 0; testNum < NUM_CACHE_ENTRIES; testNum++) {
randomStream = new RandomStream(testNum);
randomStream->Read(cacheKey, sizeof cacheKey);
rv = cache->GetCachedNetDataByID(recordID[testNum], getter_AddRefs(record));
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't obtain record using record ID");
// Match against previously stored meta-data
rv = record->GetMetaData(&metaDataLength, &metaData);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get record meta-data");
match = randomStream->Match(metaData, metaDataLength);
NS_ASSERTION(match, "Meta-data corrupted or incorrect");
nsAllocator::Free(metaData);
delete randomStream;
}
return NS_OK;
}
// Check that all cache entries in the database are enumerated and that
// no duplicates appear.
nsresult
TestEnumeration(nsINetDataCache *cache)
{
nsresult rv;
nsCOMPtr<nsINetDataCacheRecord> record;
nsCOMPtr<nsISupports> tempISupports;
nsCOMPtr<nsISimpleEnumerator> iterator;
RandomStream *randomStream;
PRUint32 metaDataLength;
char cacheKey[CACHE_KEY_LENGTH];
char *metaData;
PRUint32 testNum;
PRBool match;
PRInt32 recID;
int numRecords = 0;
// Iterate over all records in the cache
rv = cache->NewCacheEntryIterator(getter_AddRefs(iterator));
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create new cache entry iterator");
PRBool notDone;
while (1) {
// Done iterating ?
rv = iterator->HasMoreElements(&notDone);
if (NS_FAILED(rv)) return rv;
if (!notDone)
break;
// Get next record in iteration
rv = iterator->GetNext(getter_AddRefs(tempISupports));
NS_ASSERTION(NS_SUCCEEDED(rv), "iterator bustage");
record = do_QueryInterface(tempISupports);
numRecords++;
// Get record ID
rv = record->GetRecordID(&recID);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get Record ID");
testNum = mapRecordIdToTestNum(recID);
NS_ASSERTION(testNum != -1, "Corrupted Record ID ?");
// Erase mapping from table, so that duplicate enumerations are detected
recordID[testNum] = -1;
// Make sure stream matches test data
randomStream = new RandomStream(testNum);
randomStream->Read(cacheKey, sizeof cacheKey);
// Match against previously stored meta-data
rv = record->GetMetaData(&metaDataLength, &metaData);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get record meta-data");
match = randomStream->Match(metaData, metaDataLength);
NS_ASSERTION(match, "Meta-data corrupted or incorrect");
nsAllocator::Free(metaData);
delete randomStream;
}
NS_ASSERTION(numRecords == NUM_CACHE_ENTRIES, "Iteration bug");
return NS_OK;
}
// Read the test data that was written in FillCache(), checking for
// corruption, truncation.
nsresult
TestRead(nsINetDataCache *cache)
{
nsresult rv;
PRBool inCache;
nsCOMPtr<nsINetDataCacheRecord> record;
RandomStream *randomStream;
PRUint32 metaDataLength;
char cacheKey[CACHE_KEY_LENGTH];
char *metaData, *storedCacheKey;
PRUint32 testNum, storedCacheKeyLength;
PRBool match;
for (testNum = 0; testNum < NUM_CACHE_ENTRIES; testNum++) {
randomStream = new RandomStream(testNum);
randomStream->Read(cacheKey, sizeof cacheKey);
// Ensure that entry is in the cache
rv = cache->Contains(cacheKey, sizeof cacheKey, &inCache);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(inCache, "nsINetDataCache::Contains error");
rv = cache->GetCachedNetData(cacheKey, sizeof cacheKey, getter_AddRefs(record));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
// Match against previously stored meta-data
match = record->GetMetaData(&metaDataLength, &metaData);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
match = randomStream->Match(metaData, metaDataLength);
NS_ASSERTION(match, "Meta-data corrupted or incorrect");
nsAllocator::Free(metaData);
// Test GetKey() method
rv = record->GetKey(&storedCacheKeyLength, &storedCacheKey);
NS_ASSERTION(NS_SUCCEEDED(rv) &&
(storedCacheKeyLength == sizeof cacheKey) &&
!memcmp(storedCacheKey, &cacheKey[0], sizeof cacheKey),
"nsINetDataCacheRecord::GetKey failed");
nsAllocator::Free(storedCacheKey);
PRUint32 expectedStreamLength = randomStream->Next() & 0xffff;
TestReadStream(record, randomStream, expectedStreamLength);
}
WaitForEvents();
// Compute rate in MB/s
double rate = gTotalBytesRead / PR_IntervalToMilliseconds(gTotalDuration);
rate *= NUM_CACHE_ENTRIES;
rate *= 1000;
rate /= (1024 * 1024);
printf("Read %d bytes at a rate of %5.1f MB per second \n",
gTotalBytesRead, rate);
return NS_OK;
}
// Repeatedly call SetStoredContentLength() on a cache entry and make
// read the stream's data to ensure that it's not corrupted by the effect
nsresult
TestTruncation(nsINetDataCache *cache)
{
nsresult rv;
nsCOMPtr<nsINetDataCacheRecord> record;
RandomStream *randomStream;
char cacheKey[CACHE_KEY_LENGTH];
randomStream = new RandomStream(0);
randomStream->Read(cacheKey, sizeof cacheKey);
rv = cache->GetCachedNetData(cacheKey, sizeof cacheKey, getter_AddRefs(record));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
randomStream->Skip(CACHE_METADATA_LENGTH);
PRUint32 initialStreamLength = randomStream->Next() & 0xffff;
delete randomStream;
PRUint32 i;
PRUint32 delta = initialStreamLength / 64;
for (i = initialStreamLength; i >= delta; i -= delta) {
PRUint32 expectedStreamLength = i;
// Do the truncation
record->SetStoredContentLength(expectedStreamLength);
randomStream = new RandomStream(0);
randomStream->Skip(CACHE_KEY_LENGTH + CACHE_METADATA_LENGTH + 1);
TestReadStream(record, randomStream, expectedStreamLength);
WaitForEvents();
}
return NS_OK;
}
// Write known data to random offsets in a single cache entry and test
// resulting stream for correctness.
nsresult
TestOffsetWrites(nsINetDataCache *cache)
{
nsresult rv;
nsCOMPtr<nsINetDataCacheRecord> record;
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsIOutputStream> outStream;
char buf[512];
char cacheKey[CACHE_KEY_LENGTH];
RandomStream *randomStream;
randomStream = new RandomStream(0);
randomStream->Read(cacheKey, sizeof cacheKey);
rv = cache->GetCachedNetData(cacheKey, sizeof cacheKey, getter_AddRefs(record));
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't access record via opaque cache key");
nsCOMPtr<nsIFileSpec> file ;
record->GetFilename(getter_AddRefs(file)) ;
char* name ;
file->GetUnixStyleFilePath(&name) ;
printf(" file name is %s \n", name) ;
// Write buffer-fulls of data at random offsets into the cache entry.
// Data written is (offset % 0xff)
PRUint32 startingOffset;
PRUint32 streamLength = 0;
PRUint32 len = 0 ;
CounterStream *counterStream;
int i = 0;
for (i = 0; i < 257; i++) {
rv = record->NewChannel(0, getter_AddRefs(channel));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
startingOffset = streamLength ? streamLength - (randomStream->Next() % sizeof buf): 0;
rv = channel->OpenOutputStream(startingOffset, getter_AddRefs(outStream));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
truncate(name, startingOffset) ;
counterStream = new CounterStream(startingOffset);
counterStream->Read(buf, sizeof buf);
nsresult status ;
nsCOMPtr<nsIRandomAccessStore> ras = do_QueryInterface(outStream, &status);
if (NS_FAILED(status)) {
// mState = END_WRITE;
return NS_ERROR_FAILURE;
}
PRIntn offset ;
ras->Tell(&offset) ;
// printf(" offset is %d \n", offset) ;
PRUint32 numWritten;
rv = outStream->Write(buf, sizeof buf, &numWritten);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(numWritten == sizeof buf, "Write() bug?");
streamLength = startingOffset + sizeof buf;
rv = outStream->Close();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't close channel");
delete counterStream;
record->GetStoredContentLength(&len) ;
if(len != streamLength)
printf(" offset = %d is wrong, filesize = %d\n", startingOffset, len) ;
}
/*
rv = record->NewChannel(0, getter_AddRefs(channel));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
startingOffset = 208;
rv = channel->OpenOutputStream(startingOffset, getter_AddRefs(outStream));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
counterStream = new CounterStream(startingOffset);
counterStream->Read(buf, sizeof buf);
nsresult status ;
nsCOMPtr<nsIRandomAccessStore> ras = do_QueryInterface(outStream, &status);
if (NS_FAILED(status)) {
// mState = END_WRITE;
return NS_ERROR_FAILURE;
}
PRIntn offset = 0 ;
ras->Tell(&offset) ;
printf(" offset is %d \n", offset) ;
PRUint32 numWritten;
rv = outStream->Write(buf, sizeof buf, &numWritten);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(numWritten == sizeof buf, "Write() bug?");
streamLength = startingOffset + sizeof buf;
rv = outStream->Close();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't close channel");
delete counterStream;
record->GetStoredContentLength(&len) ;
if(len != streamLength)
printf(" offset = %d is wrong, filesize = %d\n", startingOffset, len) ;
*/
delete randomStream;
counterStream = new CounterStream(0);
TestReadStream(record, counterStream, streamLength);
WaitForEvents();
return NS_OK;
}
// Create entries in the network data cache, using random data for the
// key, the meta-data and the stored content data.
nsresult
FillCache(nsINetDataCache *cache)
{
nsresult rv;
PRBool inCache;
nsCOMPtr<nsINetDataCacheRecord> record;
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsIOutputStream> outStream;
char buf[1000];
PRUint32 metaDataLength;
char cacheKey[CACHE_KEY_LENGTH];
char metaData[CACHE_METADATA_LENGTH];
PRUint32 testNum;
char *data;
RandomStream *randomStream;
PRIntervalTime startTime = PR_IntervalNow();
for (testNum = 0; testNum < NUM_CACHE_ENTRIES; testNum++) {
randomStream = new RandomStream(testNum);
randomStream->Read(cacheKey, sizeof cacheKey);
// No entry should be in cache until we add it
rv = cache->Contains(cacheKey, sizeof cacheKey, &inCache);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(!inCache, "nsINetDataCache::Contains error");
rv = cache->GetCachedNetData(cacheKey, sizeof cacheKey, getter_AddRefs(record));
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't access record via opaque cache key");
// Test nsINetDataCacheRecord::GetRecordID()
rv = record->GetRecordID(&recordID[testNum]);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get Record ID");
// Test nsINetDataCache::GetNumEntries()
PRUint32 numEntries = (PRUint32)-1;
rv = cache->GetNumEntries(&numEntries);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get number of cache entries");
NS_ASSERTION(numEntries == testNum + 1, "GetNumEntries failure");
// Record meta-data should be initially empty
rv = record->GetMetaData(&metaDataLength, &data);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
if ((metaDataLength != 0) || (data != 0))
return NS_ERROR_FAILURE;
// Store random data as meta-data
randomStream->Read(metaData, sizeof metaData);
record->SetMetaData(sizeof metaData, metaData);
rv = record->NewChannel(0, getter_AddRefs(channel));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
rv = channel->OpenOutputStream(0, getter_AddRefs(outStream));
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
PRUint32 beforeOccupancy;
rv = cache->GetStorageInUse(&beforeOccupancy);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache occupancy");
int streamLength = randomStream->Next() & 0xffff;
int remaining = streamLength;
while (remaining) {
PRUint32 numWritten;
int amount = PR_MIN(sizeof buf, remaining);
randomStream->Read(buf, amount);
rv = outStream->Write(buf, amount, &numWritten);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(numWritten == (PRUint32)amount, "Write() bug?");
remaining -= amount;
}
outStream->Close();
PRUint32 afterOccupancy;
rv = cache->GetStorageInUse(&afterOccupancy);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache occupancy");
PRUint32 streamLengthInKB = streamLength >> 10;
NS_ASSERTION((afterOccupancy - beforeOccupancy) >= streamLengthInKB,
"nsINetDataCache::GetStorageInUse() is busted");
// *Now* there should be an entry in the cache
rv = cache->Contains(cacheKey, sizeof cacheKey, &inCache);
NS_ASSERTION(NS_SUCCEEDED(rv), " ");
NS_ASSERTION(inCache, "nsINetDataCache::Contains error");
delete randomStream;
}
PRIntervalTime endTime = PR_IntervalNow();
return NS_OK;
}
nsresult NS_AutoregisterComponents()
{
nsresult rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
NULL /* default */);
return rv;
}
PRBool initPref ()
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefPtr, kPrefCID, &rv);
if (NS_FAILED(rv))
return false;
nsCOMPtr<nsIFileSpec> fileSpec;
rv = NS_NewFileSpec (getter_AddRefs(fileSpec));
if (NS_FAILED(rv))
return false;
nsCString defaultPrefFile = PR_GetEnv ("MOZILLA_FIVE_HOME");
if (defaultPrefFile.Length())
defaultPrefFile += "/";
else
defaultPrefFile = "./";
defaultPrefFile += "default_prefs.js";
fileSpec->SetUnixStyleFilePath (defaultPrefFile.GetBuffer());
PRBool exists = false;
fileSpec->Exists(&exists);
if (exists)
prefPtr->ReadUserPrefsFrom(fileSpec);
else
return false;
return true;
}
int
main(int argc, char* argv[])
{
initPref() ;
nsresult rv;
nsCOMPtr<nsINetDataCache> cache;
rv = NS_AutoregisterComponents();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't register XPCOM components");
rv = nsComponentManager::CreateInstance(kDiskCacheCID, nsnull,
NS_GET_IID(nsINetDataCache),
getter_AddRefs(cache));
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create memory cache factory");
InitQueue();
PRUnichar* description;
rv = cache->GetDescription(&description);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache description");
nsCAutoString descStr(description);
printf("Testing: %s\n", descStr.GetBuffer());
rv = cache->RemoveAll();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't clear cache");
PRUint32 startOccupancy;
rv = cache->GetStorageInUse(&startOccupancy);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache occupancy");
PRUint32 numEntries = (PRUint32)-1;
rv = cache->GetNumEntries(&numEntries);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get number of cache entries");
NS_ASSERTION(numEntries == 0, "Couldn't clear cache");
rv = FillCache(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't fill cache with random test data");
rv = TestRead(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't read random test data from cache");
rv = TestRecordID(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't index records using record ID");
rv = TestEnumeration(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't successfully enumerate records");
rv = TestTruncation(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't successfully truncate records");
rv = TestOffsetWrites(cache);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't successfully write to records using non-zero offsets");
rv = cache->RemoveAll();
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't clear cache");
rv = cache->GetNumEntries(&numEntries);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get number of cache entries");
NS_ASSERTION(numEntries == 0, "Couldn't clear cache");
PRUint32 endOccupancy;
rv = cache->GetStorageInUse(&endOccupancy);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache occupancy");
NS_ASSERTION(startOccupancy == endOccupancy, "Cache occupancy not correctly computed ?");
return 0;
}

View File

@@ -1,46 +0,0 @@
# Generated automatically from Makefile.in by configure.
#
# 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@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = nkcache
LIBRARY_NAME = nkmemcache_s
REQUIRES = nspr dbm
EXPORTS=nsMemCacheCID.h
CPPSRCS = \
nsMemCache.cpp \
nsMemCacheRecord.cpp \
nsMemCacheChannel.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

View File

@@ -1,42 +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=..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = nkcache
LIBRARY_NAME = nkmemcache_s
CPP_OBJS = \
.\$(OBJDIR)\nsMemCache.obj \
.\$(OBJDIR)\nsMemCacheRecord.obj \
.\$(OBJDIR)\nsMemCacheChannel.obj \
$(NULL)
EXPORTS=nsMemCacheCID.h
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -rf $(OBJDIR)
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -1,334 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
/**
* nsMemCache is the implementation of an in-memory network-data
* cache, used to cache the responses to network retrieval commands.
* Each cache entry may contain both content, e.g. GIF image data, and
* associated metadata, e.g. HTTP headers. Each entry is indexed by
* two different keys: a record id number and an opaque key, which is
* created by the cache manager by combining the URI with a "secondary
* key", e.g. HTTP post data.
*/
#include "nsMemCache.h"
#include "nsMemCacheRecord.h"
#include "nsIGenericFactory.h"
#include "nsString.h"
#include "nsHashtable.h"
#include "nsHashtableEnumerator.h"
#include "nsEnumeratorUtils.h"
PRInt32 nsMemCache::gRecordSerialNumber = 0;
nsMemCache::nsMemCache()
: mNumEntries(0), mOccupancy(0), mEnabled(PR_TRUE),
mHashTable(0)
{
NS_INIT_REFCNT();
}
nsMemCache::~nsMemCache()
{
nsresult rv;
rv = RemoveAll();
NS_ASSERTION(NS_SUCCEEDED(rv) && (mNumEntries == 0),
"Failure to shut down memory cache. "
"Somewhere, someone is holding references to at least one cache record");
delete mHashTable;
}
nsresult
nsMemCache::Init()
{
mHashTable = new nsHashtable(256);
if (!mHashTable)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
NS_IMPL_ISUPPORTS(nsMemCache, NS_GET_IID(nsINetDataCache))
NS_IMETHODIMP
nsMemCache::GetDescription(PRUnichar * *aDescription)
{
nsAutoString description("Memory Cache");
*aDescription = description.ToNewUnicode();
if (!*aDescription)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::Contains(const char *aKey, PRUint32 aKeyLength, PRBool *aFound)
{
nsOpaqueKey *opaqueKey = new nsOpaqueKey(aKey, aKeyLength);
if (!opaqueKey)
return NS_ERROR_OUT_OF_MEMORY;
*aFound = mHashTable->Exists(opaqueKey);
delete opaqueKey;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetCachedNetData(const char *aKey, PRUint32 aKeyLength,
nsINetDataCacheRecord* *aRecord)
{
nsresult rv;
nsMemCacheRecord* record = 0;
nsOpaqueKey *opaqueKey2 = 0;
nsOpaqueKey *opaqueKey3 = 0;
nsOpaqueKey *opaqueKey;
opaqueKey = new nsOpaqueKey(aKey, aKeyLength);
if (!opaqueKey)
goto out_of_memory;
record = (nsMemCacheRecord*)mHashTable->Get(opaqueKey);
delete opaqueKey;
// No existing cache database entry was found. Create a new one.
// This requires two mappings in the hash table:
// Record ID ==> record
// Opaque key ==> record
if (!record) {
record = new nsMemCacheRecord;
if (!record)
goto out_of_memory;
rv = record->Init(aKey, aKeyLength, ++gRecordSerialNumber, this);
if (NS_FAILED(rv)) goto out_of_memory;
// Index the record by opaque key
opaqueKey2 = new nsOpaqueKey(record->mKey, record->mKeyLength);
if (!opaqueKey2) goto out_of_memory;
mHashTable->Put(opaqueKey2, record);
// Index the record by it's record ID
char *recordIDbytes = NS_REINTERPRET_CAST(char *, &record->mRecordID);
opaqueKey3 = new nsOpaqueKey(recordIDbytes,
sizeof record->mRecordID);
if (!opaqueKey3) {
// Clean up the first record from the hash table
mHashTable->Remove(opaqueKey);
goto out_of_memory;
}
mHashTable->Put(opaqueKey3, record);
// The hash table holds on to the record
record->AddRef();
delete opaqueKey2;
delete opaqueKey3;
mNumEntries++;
}
record->AddRef();
*aRecord = record;
return NS_OK;
out_of_memory:
delete opaqueKey2;
delete opaqueKey3;
delete record;
return NS_ERROR_OUT_OF_MEMORY;
}
NS_IMETHODIMP
nsMemCache::GetCachedNetDataByID(PRInt32 RecordID,
nsINetDataCacheRecord* *aRecord)
{
nsOpaqueKey opaqueKey(NS_REINTERPRET_CAST(const char *, &RecordID),
sizeof RecordID);
*aRecord = (nsINetDataCacheRecord*)mHashTable->Get(&opaqueKey);
if (*aRecord) {
NS_ADDREF(*aRecord);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_METHOD
nsMemCache::Delete(nsMemCacheRecord* aRecord)
{
nsMemCacheRecord *removedRecord;
char *recordIDbytes = NS_REINTERPRET_CAST(char *, &aRecord->mRecordID);
nsOpaqueKey opaqueRecordIDKey(recordIDbytes,
sizeof aRecord->mRecordID);
removedRecord = (nsMemCacheRecord*)mHashTable->Remove(&opaqueRecordIDKey);
NS_ASSERTION(removedRecord == aRecord, "memory cache database inconsistent");
nsOpaqueKey opaqueKey(aRecord->mKey, aRecord->mKeyLength);
removedRecord = (nsMemCacheRecord*)mHashTable->Remove(&opaqueKey);
NS_ASSERTION(removedRecord == aRecord, "memory cache database inconsistent");
aRecord->Release();
mNumEntries--;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetEnabled(PRBool *aEnabled)
{
NS_ENSURE_ARG(aEnabled);
*aEnabled = mEnabled;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::SetEnabled(PRBool aEnabled)
{
mEnabled = aEnabled;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetFlags(PRUint32 *aFlags)
{
NS_ENSURE_ARG(aFlags);
*aFlags = MEMORY_CACHE;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetNumEntries(PRUint32 *aNumEntries)
{
NS_ENSURE_ARG(aNumEntries);
*aNumEntries = mNumEntries;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetMaxEntries(PRUint32 *aMaxEntries)
{
NS_ENSURE_ARG(aMaxEntries);
*aMaxEntries = MEM_CACHE_MAX_ENTRIES;
return NS_OK;
}
static NS_METHOD
HashEntryConverter(nsHashKey *aKey, void *aValue,
void *unused, nsISupports **retval)
{
nsMemCacheRecord *record;
nsOpaqueKey *opaqueKey;
record = (nsMemCacheRecord*)aValue;
opaqueKey = (nsOpaqueKey*)aKey;
// Hash table keys that index cache entries by their record ID
// shouldn't be enumerated.
if ((opaqueKey->GetKeyLength() == sizeof(PRInt32))) {
#ifdef DEBUG
PRInt32 recordID;
record->GetRecordID(&recordID);
NS_ASSERTION(*((PRInt32*)opaqueKey->GetKey()) == recordID,
"Key has incorrect key length");
#endif
return NS_ERROR_FAILURE;
}
NS_IF_ADDREF(record);
*retval = NS_STATIC_CAST(nsISupports*, record);
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::NewCacheEntryIterator(nsISimpleEnumerator* *aIterator)
{
nsCOMPtr<nsIEnumerator> iterator;
NS_ENSURE_ARG(aIterator);
NS_NewHashtableEnumerator(mHashTable, HashEntryConverter,
mHashTable, getter_AddRefs(iterator));
return NS_NewAdapterEnumerator(aIterator, iterator);
}
NS_IMETHODIMP
nsMemCache::GetNextCache(nsINetDataCache* *aNextCache)
{
NS_ENSURE_ARG(aNextCache);
*aNextCache = mNextCache;
NS_ADDREF(*aNextCache);
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::SetNextCache(nsINetDataCache* aNextCache)
{
mNextCache = aNextCache;
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::GetStorageInUse(PRUint32 *aStorageInUse)
{
NS_ENSURE_ARG(aStorageInUse);
// Convert from bytes to KB
*aStorageInUse = (mOccupancy >> 10);
return NS_OK;
}
NS_IMETHODIMP
nsMemCache::RemoveAll(void)
{
PRBool failed;
nsCOMPtr<nsISimpleEnumerator> iterator;
nsCOMPtr<nsISupports> recordSupports;
nsCOMPtr<nsINetDataCacheRecord> record;
nsresult rv;
failed = PR_FALSE;
rv = NewCacheEntryIterator(getter_AddRefs(iterator));
if (NS_FAILED(rv))
return rv;
PRBool notDone;
while (1) {
rv = iterator->HasMoreElements(&notDone);
if (NS_FAILED(rv)) return rv;
if (!notDone)
break;
iterator->GetNext(getter_AddRefs(recordSupports));
record = do_QueryInterface(recordSupports);
recordSupports = 0;
PRUint32 bytesUsed;
record->GetStoredContentLength(&bytesUsed);
rv = record->Delete();
if (NS_FAILED(rv)) {
failed = PR_TRUE;
continue;
}
mOccupancy -= bytesUsed;
}
if (failed)
return NS_ERROR_FAILURE;
return NS_OK;
}

View File

@@ -1,83 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
/**
* nsMemCache is the implementation of an in-memory network-data
* cache, used to cache the responses to network retrieval commands.
* Each cache entry may contain both content, e.g. GIF image data, and
* associated metadata, e.g. HTTP headers. Each entry is indexed by
* two different keys: a record id number and an opaque key, which is
* created by the cache manager by combining the URI with a "secondary
* key", e.g. HTTP post data.
*/
#ifndef _nsMemCache_h_
#define _nsMemCache_h_
#include "nsINetDataCache.h"
// Maximum number of URIs that may be resident in the cache
#define MEM_CACHE_MAX_ENTRIES 1000
#define MEM_CACHE_SEGMENT_SIZE (1 << 12)
#define MEM_CACHE_MAX_ENTRY_SIZE (1 << 20)
class nsHashtable;
class nsMemCacheRecord;
class nsMemCache : public nsINetDataCache
{
public:
nsMemCache();
virtual ~nsMemCache();
nsresult Init();
// nsISupports methods
NS_DECL_ISUPPORTS
// nsINetDataCache methods
NS_DECL_NSINETDATACACHE
// Factory
static NS_METHOD nsMemCacheConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult);
protected:
PRUint32 mNumEntries;
PRUint32 mOccupancy; // Memory used, in bytes
PRBool mEnabled; // If false, bypass mem cache
nsINetDataCache* mNextCache;
// Mapping from either opaque key or record ID to nsMemCacheRecord
nsHashtable* mHashTable;
// Used to assign record ID's
static PRInt32 gRecordSerialNumber;
NS_METHOD Delete(nsMemCacheRecord* aRecord);
friend class nsMemCacheRecord;
friend class nsMemCacheChannel;
};
#endif // _nsMemCache_h_

View File

@@ -1,36 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
// XPCOM Class ID for the network data in-memory cache
#ifndef nsMEMCACHECID_h__
#define nsMEMCACHECID_h__
// {e4710560-7de2-11d3-90cb-0040056a906e}
#define NS_MEM_CACHE_FACTORY_CID \
{ \
0xe4710560, \
0x7de2, \
0x11d3, \
{0x90, 0xcb, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e} \
}
#endif // nsMEMCACHECID_h__

View File

@@ -1,464 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
#include "nsMemCache.h"
#include "nsMemCacheChannel.h"
#include "nsIStreamListener.h"
#include "nsIChannel.h"
#include "nsIStorageStream.h"
#include "nsIOutputStream.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsNetUtil.h"
#include "nsILoadGroup.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kEventQueueService, NS_EVENTQUEUESERVICE_CID);
NS_IMPL_ISUPPORTS(nsMemCacheChannel, NS_GET_IID(nsIChannel))
void
nsMemCacheChannel::NotifyStorageInUse(PRInt32 aBytesUsed)
{
mRecord->mCache->mOccupancy += aBytesUsed;
}
/**
* This class acts as an adaptor around a synchronous input stream to add async
* read capabilities. It adds methods for initiating, suspending, resuming and
* cancelling async reads.
*/
class AsyncReadStreamAdaptor : public nsIInputStream {
public:
AsyncReadStreamAdaptor(nsMemCacheChannel* aChannel, nsIInputStream *aSyncStream):
mSyncStream(aSyncStream), mDataAvailCursor(0),
mRemaining(0), mChannel(aChannel), mAvailable(0), mAborted(false), mSuspended(false)
{
NS_INIT_REFCNT();
NS_ADDREF(mChannel);
}
virtual ~AsyncReadStreamAdaptor() {
mChannel->mAsyncReadStream = 0;
NS_RELEASE(mChannel);
}
NS_DECL_ISUPPORTS
nsresult
IsPending(PRBool* aIsPending) {
*aIsPending = (mRemaining != 0) && !mAborted;
return NS_OK;
}
nsresult
Cancel(void) {
mAborted = true;
return mStreamListener->OnStopRequest(mChannel, mContext, NS_BINDING_ABORTED, nsnull);
}
nsresult
Suspend(void) { mSuspended = true; return NS_OK; }
nsresult
Resume(void) {
if (!mSuspended)
return NS_ERROR_FAILURE;
mSuspended = false;
return NextListenerEvent();
}
NS_IMETHOD
Available(PRUint32 *aNumBytes) { return mAvailable; }
NS_IMETHOD
Read(char* aBuf, PRUint32 aCount, PRUint32 *aBytesRead) {
if (mAborted)
return NS_ERROR_ABORT;
*aBytesRead = 0;
aCount = PR_MIN(aCount, mAvailable);
nsresult rv = mSyncStream->Read(aBuf, aCount, aBytesRead);
mAvailable -= *aBytesRead;
if (NS_FAILED(rv) && (rv != NS_BASE_STREAM_WOULD_BLOCK)) {
Fail();
return rv;
}
if (!mSuspended && !mAvailable) {
rv = NextListenerEvent();
if (NS_FAILED(rv)) {
Fail();
return rv;
}
}
return NS_OK;
}
NS_IMETHOD
Close() {
nsresult rv = mSyncStream->Close();
mSyncStream = 0;
mContext = 0;
mStreamListener = 0;
return rv;
}
nsresult
AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
nsISupports* aContext, nsIStreamListener* aListener) {
nsresult rv;
nsIEventQueue *eventQ;
mContext = aContext;
mStreamListener = aListener;
mRemaining = aReadCount;
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueService, &rv);
if (NS_FAILED(rv)) return rv;
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQ);
if (NS_FAILED(rv)) return rv;
rv = NS_NewAsyncStreamListener(aListener, eventQ,
getter_AddRefs(mStreamListener));
NS_RELEASE(eventQ);
if (NS_FAILED(rv)) return rv;
rv = mStreamListener->OnStartRequest(mChannel, aContext);
if (NS_FAILED(rv)) return rv;
return NextListenerEvent();
}
protected:
nsresult
Fail(void) {
mAborted = true;
return mStreamListener->OnStopRequest(mChannel, mContext, NS_BINDING_FAILED, nsnull);
}
nsresult
NextListenerEvent() {
PRUint32 available;
nsresult rv = mSyncStream->Available(&available);
if (NS_FAILED(rv)) return rv;
available -= mAvailable;
available = PR_MIN(available, mRemaining);
if (available) {
PRUint32 size = PR_MIN(available, MEM_CACHE_SEGMENT_SIZE);
rv = mStreamListener->OnDataAvailable(mChannel, mContext, this,
mDataAvailCursor, size);
mDataAvailCursor += size;
mRemaining -= size;
mAvailable += size;
return rv;
} else {
rv = mStreamListener->OnStopRequest(mChannel, mContext, NS_OK, nsnull);
AsyncReadStreamAdaptor* thisAlias = this;
NS_RELEASE(thisAlias);
return rv;
}
}
private:
nsCOMPtr<nsISupports> mContext; // Opaque context passed to AsyncRead()
nsCOMPtr<nsIStreamListener> mStreamListener; // Stream listener that has been proxied
nsCOMPtr<nsIInputStream> mSyncStream; // Underlying synchronous stream that is
// being converted to an async stream
PRUint32 mDataAvailCursor;
PRUint32 mRemaining; // Size of AsyncRead request less bytes for
// consumer OnDataAvailable's that were fired
PRUint32 mAvailable; // Number of bytes for which OnDataAvailable fired
nsMemCacheChannel* mChannel; // Associated memory cache channel, strong link
// but can not use nsCOMPtr
bool mAborted; // Abort() has been called
bool mSuspended; // Suspend() has been called
};
NS_IMPL_ISUPPORTS(AsyncReadStreamAdaptor, NS_GET_IID(nsIInputStream))
// The only purpose of this output stream wrapper is to adjust the cache's
// overall occupancy as new data flows into the cache entry.
class MemCacheWriteStreamWrapper : public nsIOutputStream {
public:
MemCacheWriteStreamWrapper(nsMemCacheChannel* aChannel, nsIOutputStream *aBaseStream):
mBaseStream(aBaseStream), mChannel(aChannel)
{
NS_INIT_REFCNT();
NS_ADDREF(mChannel);
}
virtual ~MemCacheWriteStreamWrapper() { NS_RELEASE(mChannel); };
static nsresult
Create(nsMemCacheChannel* aChannel, nsIOutputStream *aBaseStream, nsIOutputStream* *aWrapper) {
MemCacheWriteStreamWrapper *wrapper =
new MemCacheWriteStreamWrapper(aChannel, aBaseStream);
if (!wrapper) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(wrapper);
*aWrapper = wrapper;
return NS_OK;
}
NS_DECL_ISUPPORTS
NS_IMETHOD
Write(const char *aBuffer, PRUint32 aCount, PRUint32 *aNumWritten) {
*aNumWritten = 0;
nsresult rv = mBaseStream->Write(aBuffer, aCount, aNumWritten);
mChannel->NotifyStorageInUse(*aNumWritten);
return rv;
}
NS_IMETHOD
Flush() { return mBaseStream->Flush(); }
NS_IMETHOD
Close() { return mBaseStream->Close(); }
private:
nsCOMPtr<nsIOutputStream> mBaseStream;
nsMemCacheChannel* mChannel;
};
NS_IMPL_ISUPPORTS(MemCacheWriteStreamWrapper, NS_GET_IID(nsIOutputStream))
nsMemCacheChannel::nsMemCacheChannel(nsMemCacheRecord *aRecord, nsILoadGroup *aLoadGroup)
: mRecord(aRecord)
{
NS_INIT_REFCNT();
mRecord->mNumChannels++;
}
nsMemCacheChannel::~nsMemCacheChannel()
{
mRecord->mNumChannels--;
}
NS_IMETHODIMP
nsMemCacheChannel::IsPending(PRBool* aIsPending)
{
*aIsPending = PR_FALSE;
if (!mAsyncReadStream)
return NS_OK;
return mAsyncReadStream->IsPending(aIsPending);
}
NS_IMETHODIMP
nsMemCacheChannel::Cancel(void)
{
if (!mAsyncReadStream)
return NS_ERROR_FAILURE;
return mAsyncReadStream->Cancel();
}
NS_IMETHODIMP
nsMemCacheChannel::Suspend(void)
{
if (!mAsyncReadStream)
return NS_ERROR_FAILURE;
return mAsyncReadStream->Suspend();
}
NS_IMETHODIMP
nsMemCacheChannel::Resume(void)
{
if (!mAsyncReadStream)
return NS_ERROR_FAILURE;
return mAsyncReadStream->Resume();
}
NS_IMETHODIMP
nsMemCacheChannel::GetOriginalURI(nsIURI * *aURI)
{
// Not required
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetURI(nsIURI * *aURI)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::OpenInputStream(PRUint32 aStartPosition, PRInt32 aReadCount,
nsIInputStream* *aResult)
{
nsresult rv;
NS_ENSURE_ARG(aResult);
if (mInputStream)
return NS_ERROR_NOT_AVAILABLE;
rv = mRecord->mStorageStream->NewInputStream(aStartPosition, getter_AddRefs(mInputStream));
*aResult = mInputStream;
NS_ADDREF(*aResult);
return rv;
}
NS_IMETHODIMP
nsMemCacheChannel::OpenOutputStream(PRUint32 startPosition, nsIOutputStream* *aResult)
{
nsresult rv;
NS_ENSURE_ARG(aResult);
nsCOMPtr<nsIOutputStream> outputStream;
PRUint32 oldLength;
mRecord->mStorageStream->GetLength(&oldLength);
rv = mRecord->mStorageStream->GetOutputStream(startPosition, getter_AddRefs(outputStream));
if (NS_FAILED(rv)) return rv;
if (startPosition < oldLength)
NotifyStorageInUse(startPosition - oldLength);
return MemCacheWriteStreamWrapper::Create(this, outputStream, aResult);
}
NS_IMETHODIMP
nsMemCacheChannel::AsyncOpen(nsIStreamObserver *observer, nsISupports *ctxt)
{
// Not required
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
nsISupports *aContext, nsIStreamListener *aListener)
{
nsCOMPtr<nsIInputStream> inputStream;
nsresult rv = OpenInputStream(aStartPosition, aReadCount, getter_AddRefs(inputStream));
if (NS_FAILED(rv)) return rv;
AsyncReadStreamAdaptor *asyncReadStreamAdaptor;
asyncReadStreamAdaptor = new AsyncReadStreamAdaptor(this, inputStream);
if (!asyncReadStreamAdaptor)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(asyncReadStreamAdaptor);
mAsyncReadStream = asyncReadStreamAdaptor;
rv = asyncReadStreamAdaptor->AsyncRead(aStartPosition, aReadCount, aContext, aListener);
if (NS_FAILED(rv))
delete asyncReadStreamAdaptor;
return rv;
}
NS_IMETHODIMP
nsMemCacheChannel::AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition,
PRInt32 writeCount, nsISupports *ctxt,
nsIStreamObserver *observer)
{
// Not required to be implemented
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetContentType(char* *aContentType)
{
// Not required to be implemented, since it is implemented by cache manager
// NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
// FIXME - lying for the purpose of testing
*aContentType = strdup("text/html");
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheChannel::GetContentLength(PRInt32 *aContentLength)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetOwner(nsISupports* *aOwner)
{
*aOwner = mOwner.get();
NS_IF_ADDREF(*aOwner);
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheChannel::SetOwner(nsISupports* aOwner)
{
// Not required to be implemented, since it is implemented by cache manager
mOwner = aOwner;
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetNotificationCallbacks(nsIInterfaceRequestor* *aNotificationCallbacks)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks)
{
// Not required to be implemented, since it is implemented by cache manager
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -1,61 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
#ifndef _nsMemCacheChannel_h_
#define _nsMemCacheChannel_h_
#include "nsMemCacheRecord.h"
#include "nsIChannel.h"
#include "nsIInputStream.h"
#include "nsCOMPtr.h"
class AsyncReadStreamAdaptor;
class nsMemCacheChannel : public nsIChannel
{
public:
// Constructors and Destructor
nsMemCacheChannel(nsMemCacheRecord *aRecord, nsILoadGroup *aLoadGroup);
virtual ~nsMemCacheChannel();
// Declare nsISupports methods
NS_DECL_ISUPPORTS
// Declare nsIRequest methods
NS_DECL_NSIREQUEST
// Declare nsIChannel methods
NS_DECL_NSICHANNEL
protected:
void NotifyStorageInUse(PRInt32 aBytesUsed);
nsCOMPtr<nsMemCacheRecord> mRecord;
nsCOMPtr<nsIInputStream> mInputStream;
nsCOMPtr<nsISupports> mOwner;
AsyncReadStreamAdaptor* mAsyncReadStream; // non-owning pointer
friend class MemCacheWriteStreamWrapper;
friend class AsyncReadStreamAdaptor;
};
#endif // _nsMemCacheChannel_h_

View File

@@ -1,164 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
#include "nsMemCache.h"
#include "nsMemCacheRecord.h"
#include "nsMemCacheChannel.h"
#include "nsIAllocator.h"
#include "nsStorageStream.h"
static NS_DEFINE_IID(kINetDataCacheRecord, NS_INETDATACACHERECORD_IID);
nsMemCacheRecord::nsMemCacheRecord()
: mKey(0), mKeyLength(0), mMetaData(0), mMetaDataLength(0), mNumChannels(0)
{
NS_INIT_REFCNT();
}
nsMemCacheRecord::~nsMemCacheRecord()
{
if (mMetaData)
delete[] mMetaData;
if (mKey)
delete[] mKey;
}
NS_IMPL_ISUPPORTS(nsMemCacheRecord, NS_GET_IID(nsINetDataCacheRecord))
NS_IMETHODIMP
nsMemCacheRecord::GetKey(PRUint32 *aLength, char **aResult)
{
NS_ENSURE_ARG(aResult);
*aResult = (char *)nsAllocator::Alloc(mKeyLength);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
memcpy(*aResult, mKey, mKeyLength);
*aLength = mKeyLength;
return NS_OK;
}
nsresult
nsMemCacheRecord::Init(const char *aKey, PRUint32 aKeyLength,
PRUint32 aRecordID, nsMemCache *aCache)
{
nsresult rv;
NS_ASSERTION(!mKey, "Memory cache record key set multiple times");
rv = NS_NewStorageStream(MEM_CACHE_SEGMENT_SIZE, MEM_CACHE_MAX_ENTRY_SIZE,
getter_AddRefs(mStorageStream));
if (NS_FAILED(rv)) return rv;
mKey = new char[aKeyLength];
if (!mKey)
return NS_ERROR_OUT_OF_MEMORY;
memcpy(mKey, aKey, aKeyLength);
mKeyLength = aKeyLength;
mRecordID = aRecordID;
mCache = aCache;
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheRecord::GetRecordID(PRInt32 *aRecordID)
{
NS_ENSURE_ARG(aRecordID);
*aRecordID = mRecordID;
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheRecord::GetMetaData(PRUint32 *aLength, char **aResult)
{
NS_ENSURE_ARG(aResult);
*aResult = 0;
if (mMetaDataLength) {
*aResult = (char*)nsAllocator::Alloc(mMetaDataLength);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
memcpy(*aResult, mMetaData, mMetaDataLength);
}
*aLength = mMetaDataLength;
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheRecord::SetMetaData(PRUint32 aLength, const char *aData)
{
if (mMetaData)
delete[] mMetaData;
mMetaData = new char[aLength];
if (!mMetaData)
return NS_ERROR_OUT_OF_MEMORY;
memcpy(mMetaData, aData, aLength);
mMetaDataLength = aLength;
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheRecord::GetStoredContentLength(PRUint32 *aStoredContentLength)
{
NS_ENSURE_ARG(aStoredContentLength);
return mStorageStream->GetLength(aStoredContentLength);
}
NS_IMETHODIMP
nsMemCacheRecord::SetStoredContentLength(PRUint32 aStoredContentLength)
{
PRUint32 before, after;
mStorageStream->GetLength(&before);
nsresult rv = mStorageStream->SetLength(aStoredContentLength);
if (NS_FAILED(rv)) return rv;
mStorageStream->GetLength(&after);
mCache->mOccupancy -= (before - after);
return NS_OK;
}
NS_IMETHODIMP
nsMemCacheRecord::Delete(void)
{
if (mNumChannels)
return NS_ERROR_NOT_AVAILABLE;
return mCache->Delete(this);
}
NS_IMETHODIMP
nsMemCacheRecord::GetFilename(nsIFileSpec* *aFilename)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheRecord::NewChannel(nsILoadGroup *aLoadGroup, nsIChannel* *aResult)
{
NS_ENSURE_ARG(aResult);
nsMemCacheChannel* channel = new nsMemCacheChannel(this, aLoadGroup);
if (!channel)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(channel);
*aResult = NS_STATIC_CAST(nsIChannel*, channel);
return NS_OK;
}

View File

@@ -1,65 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
*/
#ifndef _nsMemCacheRecord_h_
#define _nsMemCacheRecord_h_
#include "nsINetDataCacheRecord.h"
#include "nsCOMPtr.h"
class nsMemCache;
class nsIStorageStream;
class nsMemCacheRecord : public nsINetDataCacheRecord
{
public:
// Declare interface methods
NS_DECL_ISUPPORTS
NS_DECL_NSINETDATACACHERECORD
protected:
// Constructors and Destructor
nsMemCacheRecord();
virtual ~nsMemCacheRecord();
nsresult Init(const char *aKey, PRUint32 aKeyLength,
PRUint32 aRecordID, nsMemCache *aCache);
char* mKey; // opaque database key for this record
PRUint32 mKeyLength; // length, in bytes, of mKey
PRInt32 mRecordID; // An alternate key for this record
char* mMetaData; // opaque URI metadata
PRUint32 mMetaDataLength; // length, in bytes, of mMetaData
nsMemCache* mCache; // weak pointer to the cache database
// that this record inhabits
nsCOMPtr<nsIStorageStream> mStorageStream;
PRUint32 mNumChannels; // Count un-Release'ed nsIChannels
friend class nsMemCache;
friend class nsMemCacheChannel;
};
#endif // _nsMemCacheRecord_h_

View File

@@ -1,51 +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 = nkcache
LIBRARY_NAME = nkcachemgr_s
REQUIRES = nspr
CPPSRCS = \
nsCacheManager.cpp \
nsCachedNetData.cpp \
nsReplacementPolicy.cpp \
nsCacheEntryChannel.cpp \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir)/../public -I$(srcdir)/../include
EXTRA_LIBS = $(NSPR_LIBS)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

View File

@@ -1,45 +0,0 @@
#!gmake
#
# 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=..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = nkcache
LIBRARY_NAME = nkcachemgr_s
CPP_OBJS = \
.\$(OBJDIR)\nsCacheManager.obj \
.\$(OBJDIR)\nsCachedNetData.obj \
.\$(OBJDIR)\nsReplacementPolicy.obj \
.\$(OBJDIR)\nsCacheEntryChannel.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -rf $(OBJDIR)
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -1,260 +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 Communicator client code, released
* March 31, 1998.
*
* 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):
* Scott Furman, fur@netscape.com
*/
#include "nsCacheManager.h"
#include "nsCacheEntryChannel.h"
#include "nsIOutputStream.h"
#include "nsIIOService.h"
#include "nsIServiceManager.h"
#include "nsIStreamListener.h"
nsCacheEntryChannel::nsCacheEntryChannel(nsCachedNetData* aCacheEntry, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup):
nsChannelProxy(aChannel), mCacheEntry(aCacheEntry), mLoadGroup(aLoadGroup), mLoadAttributes(0)
{
NS_ASSERTION(aCacheEntry->mChannelCount < 0xFF, "Overflowed channel counter");
mCacheEntry->mChannelCount++;
NS_INIT_REFCNT();
}
nsCacheEntryChannel::~nsCacheEntryChannel()
{
mCacheEntry->mChannelCount--;
}
NS_IMPL_ISUPPORTS3(nsCacheEntryChannel, nsISupports, nsIChannel, nsIRequest)
// A proxy for nsIOutputStream
class CacheOutputStream : public nsIOutputStream {
public:
CacheOutputStream(nsIOutputStream *aOutputStream, nsCachedNetData *aCacheEntry):
mOutputStream(aOutputStream), mCacheEntry(aCacheEntry), mStartTime(PR_Now())
{ NS_INIT_REFCNT(); }
virtual ~CacheOutputStream() {}
NS_DECL_ISUPPORTS
NS_IMETHOD Close() {
mCacheEntry->NoteDownloadTime(mStartTime, PR_Now());
mCacheEntry->ClearFlag(nsCachedNetData::UPDATE_IN_PROGRESS);
return mOutputStream->Close();
}
NS_IMETHOD Flush() { return mOutputStream->Flush(); }
NS_IMETHOD
Write(const char *aBuf, PRUint32 aCount, PRUint32 *aActualBytes) {
nsresult rv;
*aActualBytes = 0;
rv = mOutputStream->Write(aBuf, aCount, aActualBytes);
mCacheEntry->mLogicalLength += *aActualBytes;
if (NS_FAILED(rv)) return rv;
nsCacheManager::LimitCacheSize();
return rv;
}
protected:
nsCOMPtr<nsIOutputStream> mOutputStream;
nsCOMPtr<nsCachedNetData> mCacheEntry;
// Time at which stream was opened
PRTime mStartTime;
};
NS_IMPL_ISUPPORTS(CacheOutputStream, NS_GET_IID(nsIOutputStream))
NS_IMETHODIMP
nsCacheEntryChannel::OpenOutputStream(PRUint32 aStartPosition, nsIOutputStream* *aOutputStream)
{
nsresult rv;
nsCOMPtr<nsIOutputStream> baseOutputStream;
rv = mChannel->OpenOutputStream(aStartPosition, getter_AddRefs(baseOutputStream));
if (NS_FAILED(rv)) return rv;
mCacheEntry->NoteUpdate();
mCacheEntry->NoteAccess();
mCacheEntry->mLogicalLength = aStartPosition;
*aOutputStream = new CacheOutputStream(baseOutputStream, mCacheEntry);
if (!*aOutputStream)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*aOutputStream);
return NS_OK;
}
NS_IMETHODIMP
nsCacheEntryChannel::OpenInputStream(PRUint32 aStartPosition, PRInt32 aReadCount,
nsIInputStream* *aInputStream)
{
mCacheEntry->NoteAccess();
return mChannel->OpenInputStream(aStartPosition, aReadCount, aInputStream);
}
class CacheManagerStreamListener: public nsIStreamListener {
public:
CacheManagerStreamListener(nsIStreamListener *aListener,
nsILoadGroup *aLoadGroup, nsIChannel *aChannel):
mListener(aListener), mLoadGroup(aLoadGroup), mChannel(aChannel)
{ NS_INIT_REFCNT(); }
virtual ~CacheManagerStreamListener() {}
private:
NS_DECL_ISUPPORTS
NS_IMETHOD
OnDataAvailable(nsIChannel *channel, nsISupports *aContext,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count) {
return mListener->OnDataAvailable(mChannel, aContext, inStr, sourceOffset, count);
}
NS_IMETHOD
OnStartRequest(nsIChannel *channel, nsISupports *aContext) {
if (mLoadGroup)
mLoadGroup->AddChannel(mChannel, aContext);
return mListener->OnStartRequest(mChannel, aContext);
}
NS_IMETHOD
OnStopRequest(nsIChannel *channel, nsISupports *aContext,
nsresult status, const PRUnichar *errorMsg) {
nsresult rv;
rv = mListener->OnStopRequest(mChannel, aContext, status, errorMsg);
if (mLoadGroup)
mLoadGroup->RemoveChannel(mChannel, aContext, status, errorMsg);
return rv;
}
private:
nsCOMPtr<nsIStreamListener> mListener;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIChannel> mChannel;
};
NS_IMPL_ISUPPORTS2(CacheManagerStreamListener, nsIStreamListener, nsIStreamObserver)
NS_IMETHODIMP
nsCacheEntryChannel::AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
nsISupports *aContext, nsIStreamListener *aListener)
{
nsresult rv;
mCacheEntry->NoteAccess();
nsCOMPtr<nsIStreamListener> headListener;
if (mLoadGroup) {
mLoadGroup->GetDefaultLoadAttributes(&mLoadAttributes);
// Create a load group "proxy" listener...
nsCOMPtr<nsILoadGroupListenerFactory> factory;
rv = mLoadGroup->GetGroupListenerFactory(getter_AddRefs(factory));
if (NS_SUCCEEDED(rv) && factory) {
rv = factory->CreateLoadGroupListener(aListener,
getter_AddRefs(headListener));
if (NS_FAILED(rv)) return rv;
}
} else {
headListener = aListener;
}
CacheManagerStreamListener* cacheManagerStreamListener;
nsIChannel *channelForListener;
channelForListener = mProxyChannel ? mProxyChannel : this;
cacheManagerStreamListener =
new CacheManagerStreamListener(headListener, mLoadGroup, channelForListener);
if (!cacheManagerStreamListener) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(cacheManagerStreamListener);
rv = mChannel->AsyncRead(aStartPosition, aReadCount, aContext,
cacheManagerStreamListener);
NS_RELEASE(cacheManagerStreamListener);
return rv;
}
// No async writes allowed to the cache yet
NS_IMETHODIMP
nsCacheEntryChannel::AsyncWrite(nsIInputStream *aFromStream, PRUint32 aStartPosition,
PRInt32 aWriteCount, nsISupports *aContext,
nsIStreamObserver *aObserver)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsCacheEntryChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
{
*aLoadGroup = mLoadGroup;
return NS_OK;
}
NS_IMETHODIMP
nsCacheEntryChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
*aLoadAttributes = mLoadAttributes;
return NS_OK;
}
NS_IMETHODIMP
nsCacheEntryChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
mLoadAttributes = aLoadAttributes;
return NS_OK;
}
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
NS_IMETHODIMP
nsCacheEntryChannel::GetURI(nsIURI * *aURI)
{
char* spec;
nsresult rv;
rv = mCacheEntry->GetUriSpec(&spec);
if (NS_FAILED(rv)) return rv;
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = serv->NewURI(spec, 0, aURI);
nsAllocator::Free(spec);
return rv;
}
NS_IMETHODIMP
nsCacheEntryChannel::GetOriginalURI(nsIURI * *aURI)
{
// FIXME - should return original URI passed into NewChannel() ?
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -1,82 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
#ifndef _nsCacheEntryChannel_h_
#define _nsCacheEntryChannel_h_
#include "nsCOMPtr.h"
#include "nsIChannel.h"
#include "nsCachedNetData.h"
#include "nsILoadGroup.h"
class nsIStreamListener;
// A proxy for an nsIChannel, useful when only a few nsIChannel
// methods must be overridden
class nsChannelProxy : public nsIChannel {
public:
NS_FORWARD_NSICHANNEL(mChannel->)
NS_FORWARD_NSIREQUEST(mChannel->)
protected:
nsChannelProxy(nsIChannel* aChannel):mChannel(aChannel) {};
virtual ~nsChannelProxy() {};
nsCOMPtr<nsIChannel> mChannel;
};
// Override several nsIChannel methods so that they interact with the cache manager
class nsCacheEntryChannel : public nsChannelProxy {
public:
NS_DECL_ISUPPORTS
NS_IMETHOD OpenOutputStream(PRUint32 aStartPosition, nsIOutputStream* *aOutputStream);
NS_IMETHOD OpenInputStream(PRUint32 aStartPosition, PRInt32 aReadCount,
nsIInputStream* *aInputStream);
NS_IMETHOD AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
nsISupports *aContext, nsIStreamListener *aListener);
NS_IMETHOD AsyncWrite(nsIInputStream *aFromStream, PRUint32 aStartPosition,
PRInt32 aWriteCount, nsISupports *aContext,
nsIStreamObserver *aObserver);
NS_IMETHOD GetLoadAttributes(nsLoadFlags *aLoadAttributes);
NS_IMETHOD SetLoadAttributes(nsLoadFlags aLoadAttributes);
NS_IMETHOD GetLoadGroup(nsILoadGroup* *aLoadGroup);
NS_IMETHOD GetURI(nsIURI * *aURI);
NS_IMETHOD GetOriginalURI(nsIURI * *aURI);
protected:
nsCacheEntryChannel(nsCachedNetData* aCacheEntry, nsIChannel* aChannel, nsILoadGroup* aLoadGroup);
virtual ~nsCacheEntryChannel();
friend class nsCachedNetData;
private:
nsCOMPtr<nsCachedNetData> mCacheEntry;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIChannel> mProxyChannel;
nsLoadFlags mLoadAttributes;
};
#endif // _nsCacheEntryChannel_h_

View File

@@ -1,496 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
#include "nsINetDataCache.h"
#include "nsCacheManager.h"
#include "nsCachedNetData.h"
#include "nsReplacementPolicy.h"
#include "nsString.h"
#include "nsIURI.h"
#include "nsHashtable.h"
#include "nsIComponentManager.h"
#include "nsINetDataDiskCache.h"
// Limit the number of entries in the cache to conserve memory space
// in the nsReplacementPolicy code
#define MAX_MEM_CACHE_ENTRIES 800
#define MAX_DISK_CACHE_ENTRIES 3200
// Cache capacities in MB, overridable via APIs
#define DEFAULT_MEMORY_CACHE_CAPACITY 2000
#define DEFAULT_DISK_CACHE_CAPACITY 10000
#define CACHE_HIGH_WATER_MARK(capacity) ((PRUint32)(0.98 * (capacity)))
#define CACHE_LOW_WATER_MARK(capacity) ((PRUint32)(0.97 * (capacity)))
nsCacheManager* gCacheManager = 0;
NS_IMPL_ISUPPORTS(nsCacheManager, NS_GET_IID(nsINetDataCacheManager))
nsCacheManager::nsCacheManager()
: mActiveCacheRecords(0),
mDiskCacheCapacity(DEFAULT_DISK_CACHE_CAPACITY),
mMemCacheCapacity(DEFAULT_MEMORY_CACHE_CAPACITY)
{
NS_ASSERTION(!gCacheManager, "Multiple cache managers created");
gCacheManager = this;
NS_INIT_REFCNT();
}
nsCacheManager::~nsCacheManager()
{
gCacheManager = 0;
delete mActiveCacheRecords;
delete mMemSpaceManager;
delete mDiskSpaceManager;
}
nsresult
nsCacheManager::Init()
{
nsresult rv;
mActiveCacheRecords = new nsHashtable(64);
if (!mActiveCacheRecords)
return NS_ERROR_OUT_OF_MEMORY;
// Instantiate the memory cache component
rv = nsComponentManager::CreateInstance(NS_NETWORK_MEMORY_CACHE_PROGID,
nsnull,
NS_GET_IID(nsINetDataCache),
getter_AddRefs(mMemCache));
if (NS_FAILED(rv))
return rv;
rv = nsComponentManager::CreateInstance(NS_NETWORK_FLAT_CACHE_PROGID,
nsnull,
NS_GET_IID(nsINetDataCache),
getter_AddRefs(mFlatCache));
if (NS_FAILED(rv)) {
// For now, we don't require a flat cache module to be present
if (rv != NS_ERROR_FACTORY_NOT_REGISTERED)
return rv;
}
#ifdef FILE_CACHE_IS_READY
// Instantiate the file cache component
rv = nsComponentManager::CreateInstance(NS_NETWORK_FILE_CACHE_PROGID,
nsnull,
NS_GET_IID(nsINetDataCache),
getter_AddRefs(mFileCache));
if (NS_FAILED(rv)) {
NS_WARNING("No disk cache present");
}
#endif
// Set up linked list of caches in search order
mCacheSearchChain = mMemCache;
if (mFlatCache) {
mMemCache->SetNextCache(mFlatCache);
mFlatCache->SetNextCache(mFileCache);
} else {
mMemCache->SetNextCache(mFileCache);
}
// TODO - Load any extension caches here
// Initialize replacement policy for memory cache module
mMemSpaceManager = new nsReplacementPolicy;
if (!mMemSpaceManager)
return NS_ERROR_OUT_OF_MEMORY;
rv = mMemSpaceManager->Init(MAX_MEM_CACHE_ENTRIES);
if (NS_FAILED(rv)) return rv;
rv = mMemSpaceManager->AddCache(mMemCache);
// Initialize replacement policy for disk cache modules (file
// cache and flat cache)
mDiskSpaceManager = new nsReplacementPolicy;
if (!mDiskSpaceManager)
return NS_ERROR_OUT_OF_MEMORY;
rv = mDiskSpaceManager->Init(MAX_DISK_CACHE_ENTRIES);
if (NS_FAILED(rv)) return rv;
if (mFileCache) {
rv = mDiskSpaceManager->AddCache(mFileCache);
if (NS_FAILED(rv)) return rv;
}
if (mFlatCache) {
rv = mDiskSpaceManager->AddCache(mFlatCache);
if (NS_FAILED(rv)) return rv;
}
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::GetCachedNetData(const char *aUriSpec, const char *aSecondaryKey,
PRUint32 aSecondaryKeyLength,
PRUint32 aFlags, nsICachedNetData* *aResult)
{
nsCachedNetData *cachedData;
nsresult rv;
nsINetDataCache *cache;
nsReplacementPolicy *spaceManager;
if (aFlags & CACHE_AS_FILE) {
cache = mFileCache;
spaceManager = mDiskSpaceManager;
// Ensure that cache is initialized
if (mDiskCacheCapacity == (PRUint32)-1)
return NS_ERROR_NOT_AVAILABLE;
} else if ((aFlags & BYPASS_PERSISTENT_CACHE) || !mDiskCacheCapacity) {
cache = mMemCache;
spaceManager = mMemSpaceManager;
} else {
cache = mFlatCache ? mFlatCache : mFileCache;
spaceManager = mDiskSpaceManager;
}
// Construct the cache key by appending the secondary key to the URI spec
nsCAutoString cacheKey(aUriSpec);
// Insert NUL at end of URI spec
cacheKey += '\0';
if (aSecondaryKey)
cacheKey.Append(aSecondaryKey, aSecondaryKeyLength);
nsStringKey key(cacheKey);
cachedData = (nsCachedNetData*)mActiveCacheRecords->Get(&key);
// There is no existing instance of nsCachedNetData for this URL.
// Make one from the corresponding record in the cache module.
if (cachedData) {
NS_ASSERTION(cache == cachedData->mCache,
"Cannot yet handle simultaneously active requests for the "
"same URL using different caches");
NS_ADDREF(cachedData);
} else {
rv = spaceManager->GetCachedNetData(cacheKey.GetBuffer(), cacheKey.Length(),
cache, &cachedData);
if (NS_FAILED(rv)) return rv;
mActiveCacheRecords->Put(&key, cachedData);
}
*aResult = cachedData;
return NS_OK;
}
// Remove this cache entry from the list of active ones
nsresult
nsCacheManager::NoteDormant(nsCachedNetData* aEntry)
{
nsresult rv;
PRUint32 keyLength;
char* key;
nsCOMPtr<nsINetDataCacheRecord> record;
nsCachedNetData* deletedEntry;
rv = aEntry->GetRecord(getter_AddRefs(record));
if (NS_FAILED(rv)) return rv;
rv = record->GetKey(&keyLength, &key);
if (NS_FAILED(rv)) return rv;
nsStringKey hashTableKey(nsCString(key, keyLength));
deletedEntry = (nsCachedNetData*)gCacheManager->mActiveCacheRecords->Remove(&hashTableKey);
NS_ASSERTION(deletedEntry == aEntry, "Hash table inconsistency");
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::Contains(const char *aUriSpec, const char *aSecondaryKey,
PRUint32 aSecondaryKeyLength,
PRUint32 aFlags, PRBool *aResult)
{
nsINetDataCache *cache;
nsReplacementPolicy *spaceManager;
nsCachedNetData *cachedData;
if (aFlags & CACHE_AS_FILE) {
cache = mFileCache;
spaceManager = mDiskSpaceManager;
} else if ((aFlags & BYPASS_PERSISTENT_CACHE) ||
(!mFileCache && !mFlatCache) || !mDiskCacheCapacity) {
cache = mMemCache;
spaceManager = mMemSpaceManager;
} else {
cache = mFlatCache ? mFlatCache : mFileCache;
spaceManager = mDiskSpaceManager;
}
// Construct the cache key by appending the secondary key to the URI spec
nsCAutoString cacheKey(aUriSpec);
// Insert NUL between URI spec and secondary key
cacheKey += '\0';
cacheKey.Append(aSecondaryKey, aSecondaryKeyLength);
// Locate the record using (URI + secondary key)
nsStringKey key(cacheKey);
cachedData = (nsCachedNetData*)mActiveCacheRecords->Get(&key);
if (cachedData && (cache == cachedData->mCache)) {
*aResult = PR_TRUE;
return NS_OK;
} else {
// No active cache entry, see if there is a dormant one
return cache->Contains(cacheKey.GetBuffer(), cacheKey.Length(), aResult);
}
}
NS_IMETHODIMP
nsCacheManager::GetNumEntries(PRUint32 *aNumEntries)
{
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> iterator;
nsCOMPtr<nsISupports> cacheSupports;
nsCOMPtr<nsINetDataCache> cache;
PRUint32 totalEntries = 0;
rv = NewCacheModuleIterator(getter_AddRefs(iterator));
if (NS_FAILED(rv)) return rv;
while (1) {
PRBool notDone;
rv = iterator->HasMoreElements(&notDone);
if (NS_FAILED(rv)) return rv;
if (!notDone)
break;
iterator->GetNext(getter_AddRefs(cacheSupports));
cache = do_QueryInterface(cacheSupports);
PRUint32 numEntries;
rv = cache->GetNumEntries(&numEntries);
if (NS_FAILED(rv)) return rv;
totalEntries += numEntries;
}
*aNumEntries = totalEntries;
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::NewCacheEntryIterator(nsISimpleEnumerator* *aResult)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
class CacheEnumerator : public nsISimpleEnumerator
{
public:
CacheEnumerator(nsINetDataCache* aFirstCache):mCache(aFirstCache)
{ NS_INIT_REFCNT(); }
virtual ~CacheEnumerator() {};
NS_DECL_ISUPPORTS
NS_IMETHODIMP
HasMoreElements(PRBool* aMoreElements) {
*aMoreElements = (mCache != 0);
return NS_OK;
}
NS_IMETHODIMP
GetNext(nsISupports* *aSupports) {
*aSupports = mCache;
if (!mCache)
return NS_ERROR_FAILURE;
NS_ADDREF(*aSupports);
nsCOMPtr<nsINetDataCache> nextCache;
nsresult rv = mCache->GetNextCache(getter_AddRefs(nextCache));
mCache = nextCache;
return rv;
}
private:
nsCOMPtr<nsINetDataCache> mCache;
};
NS_IMPL_ISUPPORTS(CacheEnumerator, NS_GET_IID(nsISimpleEnumerator))
NS_IMETHODIMP
nsCacheManager::NewCacheModuleIterator(nsISimpleEnumerator* *aResult)
{
*aResult = new CacheEnumerator(mCacheSearchChain);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::RemoveAll(void)
{
nsresult rv, result;
nsCOMPtr<nsISimpleEnumerator> iterator;
nsCOMPtr<nsINetDataCache> cache;
nsCOMPtr<nsISupports> iSupports;
result = NS_OK;
rv = NewCacheModuleIterator(getter_AddRefs(iterator));
if (NS_FAILED(rv)) return rv;
while (1) {
PRBool notDone;
rv = iterator->HasMoreElements(&notDone);
if (NS_FAILED(rv)) return rv;
if (!notDone)
break;
iterator->GetNext(getter_AddRefs(iSupports));
cache = do_QueryInterface(iSupports);
PRUint32 cacheFlags;
rv = cache->GetFlags(&cacheFlags);
if (NS_FAILED(rv)) return rv;
if ((cacheFlags & nsINetDataCache::READ_ONLY) == 0) {
rv = cache->RemoveAll();
if (NS_FAILED(rv))
result = rv;
}
}
return result;
}
nsresult
nsCacheManager::LimitMemCacheSize()
{
nsresult rv;
nsReplacementPolicy* spaceManager;
NS_ASSERTION(gCacheManager, "No cache manager");
spaceManager = gCacheManager->mMemSpaceManager;
PRUint32 occupancy;
rv = spaceManager->GetStorageInUse(&occupancy);
if (NS_FAILED(rv)) return rv;
PRUint32 memCacheCapacity = gCacheManager->mMemCacheCapacity;
if (occupancy > CACHE_HIGH_WATER_MARK(memCacheCapacity))
return spaceManager->Evict(CACHE_LOW_WATER_MARK(memCacheCapacity));
return NS_OK;
}
nsresult
nsCacheManager::LimitDiskCacheSize()
{
nsresult rv;
nsReplacementPolicy* spaceManager;
NS_ASSERTION(gCacheManager, "No cache manager");
spaceManager = gCacheManager->mDiskSpaceManager;
PRUint32 occupancy;
rv = spaceManager->GetStorageInUse(&occupancy);
if (NS_FAILED(rv)) return rv;
PRUint32 diskCacheCapacity = gCacheManager->mDiskCacheCapacity;
if (occupancy > CACHE_HIGH_WATER_MARK(diskCacheCapacity))
return spaceManager->Evict(CACHE_LOW_WATER_MARK(diskCacheCapacity));
return NS_OK;
}
nsresult
nsCacheManager::LimitCacheSize()
{
nsresult rv;
rv = LimitDiskCacheSize();
if (NS_FAILED(rv)) return rv;
rv = LimitMemCacheSize();
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::SetMemCacheCapacity(PRUint32 aCapacity)
{
mMemCacheCapacity = aCapacity;
LimitCacheSize();
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::GetMemCacheCapacity(PRUint32* aCapacity)
{
NS_ENSURE_ARG_POINTER(aCapacity);
*aCapacity = mMemCacheCapacity;
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::SetDiskCacheCapacity(PRUint32 aCapacity)
{
mDiskCacheCapacity = aCapacity;
LimitCacheSize();
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::GetDiskCacheCapacity(PRUint32* aCapacity)
{
NS_ENSURE_ARG_POINTER(aCapacity);
*aCapacity = mDiskCacheCapacity;
return NS_OK;
}
NS_IMETHODIMP
nsCacheManager::SetDiskCacheFolder(nsIFileSpec* aFolder)
{
NS_ENSURE_ARG(aFolder);
if (!mFileCache)
return NS_ERROR_NOT_AVAILABLE;
nsCOMPtr<nsINetDataDiskCache> fileCache;
fileCache = do_QueryInterface(mFileCache);
return fileCache->SetDiskCacheFolder(aFolder);
}
NS_IMETHODIMP
nsCacheManager::GetDiskCacheFolder(nsIFileSpec* *aFolder)
{
NS_ENSURE_ARG(aFolder);
if (!mFileCache)
return NS_ERROR_NOT_AVAILABLE;
nsCOMPtr<nsINetDataDiskCache> fileCache;
fileCache = do_QueryInterface(mFileCache);
return fileCache->GetDiskCacheFolder(aFolder);
}

View File

@@ -1,99 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
#ifndef _nsCacheManager_h_
#define _nsCacheManager_h_
// 2030f0b0-9567-11d3-90d3-0040056a906e
#define NS_CACHE_MANAGER_CID \
{ \
0x2030f0b0, \
0x9567, \
0x11d3, \
{0x90, 0xd3, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e} \
}
#include "nsINetDataCacheManager.h"
#include "nsCOMPtr.h"
class nsHashtable;
class nsReplacementPolicy;
class nsCachedNetData;
class nsCacheManager : public nsINetDataCacheManager {
public:
nsCacheManager();
virtual ~nsCacheManager();
NS_METHOD Init();
// nsISupports methods
NS_DECL_ISUPPORTS
// nsINetDataCacheManager methods
NS_DECL_NSINETDATACACHEMANAGER
private:
// Mapping from cache key to nsCachedNetData, but only for those cache
// entries with external references, i.e. those referred to outside the
// cache manager
nsHashtable* mActiveCacheRecords;
// Memory cache
nsCOMPtr<nsINetDataCache> mMemCache;
// Flat-file database cache; All content aggregated into single disk file
nsCOMPtr<nsINetDataCache> mFlatCache;
// stream-as-file cache
nsCOMPtr<nsINetDataCache> mFileCache;
// Unified replacement policy for flat-cache and file-cache
nsReplacementPolicy* mDiskSpaceManager;
// Replacement policy for memory cache
nsReplacementPolicy* mMemSpaceManager;
// List of caches in search order
nsINetDataCache* mCacheSearchChain;
// Combined file/flat cache capacity, in KB
PRUint32 mDiskCacheCapacity;
// Memory cache capacity, in KB
PRUint32 mMemCacheCapacity;
protected:
static nsresult NoteDormant(nsCachedNetData* aEntry);
static nsresult LimitCacheSize();
static nsresult LimitMemCacheSize();
static nsresult LimitDiskCacheSize();
friend class nsCachedNetData;
friend class CacheOutputStream;
};
#endif // _nsCacheManager_h_

File diff suppressed because it is too large Load Diff

View File

@@ -1,242 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
#ifndef _nsCachedNetData_h_
#define _nsCachedNetData_h_
#include "nsICachedNetData.h"
#include "nsCOMPtr.h"
#include "nsINetDataCacheRecord.h"
class nsINetDataCache;
class nsIStreamAsFileObserver;
class nsIStreamAsFile;
class nsIArena;
class StreamAsFileObserverClosure;
class CacheMetaData;
// Number of recent access times recorded
#define MAX_K 3
/**
* FIXME - add comment. There are a lot of these data structures resident in
* memory, so be careful about adding members unnecessarily.
*/
class nsCachedNetData : public nsICachedNetData {
public:
NS_DECL_ISUPPORTS
// nsICachedNetData methods
NS_DECL_NSICACHEDNETDATA
NS_METHOD Init(nsINetDataCacheRecord *aRecord, nsINetDataCache *aCache);
protected:
// Bits for mFlags, below
typedef enum {
DIRTY = 1 << 0, // Cache entry data needs to be flushed to database
// ==== Flags that can be set by the protocol handler ====
ALLOW_PARTIAL = 1 << 1, // Protocol handler supports partial fetching
UPDATE_IN_PROGRESS = 1 << 2, // Protocol handler now modifying cache data
// ==== Cache-entry state flags. At most one of these flags can be set ====
TRUNCATED_CONTENT = 1 << 4, // Entry contains valid content, but it has
// been truncated by cache manager
// A previously-used cache entry, which has been purged of all cached
// content and protocol-private data. This cache entry can be refilled
// with new content or it may be retained in this vestigial state
// because the usage statistics it contains will be used by the
// replacement policy if the same URI is ever cached again.
VESTIGIAL = 1 << 5,
// ==== Memory usage status bits. At most one of these flags can be set ====
RECYCLED = 1 << 8, // Previously associated database record has
// been deleted; This cache entry is available
// for recycling.
DORMANT = 1 << 9, // No references to this cache entry, except by
// the cache manager itself
// ==== Setter bits ====
LAST_MODIFIED_KNOWN = 1 <<12, // Protocol handler called SetLastModifiedTime()
EXPIRATION_KNOWN = 1 <<13, // Protocol handler called SetExpirationTime()
STALE_TIME_KNOWN = 1 <<14, // Protocol handler called SetStaleTime()
// ==== Useful flag combinations ====
// Cache entry not eligible for eviction
UNEVICTABLE = VESTIGIAL | RECYCLED | UPDATE_IN_PROGRESS,
// State flags that are in-memory only, i.e. not persistent
TRANSIENT_FLAGS = DIRTY | RECYCLED | DORMANT
} Flag;
PRBool GetFlag(Flag aFlag) { return (mFlags & aFlag) != 0; }
nsresult GetFlag(PRBool *aResult, Flag aFlag) { *aResult = GetFlag(aFlag); return NS_OK; }
// Set a boolean flag for the cache entry
nsresult SetFlag(PRBool aValue, Flag aFlag);
nsresult SetFlag(Flag aFlag) { return SetFlag(PR_TRUE, aFlag); }
nsresult ClearFlag(Flag aFlag) { return SetFlag(PR_FALSE, aFlag); }
void ComputeProfit(PRUint32 aCurrentTime);
static int Compare(const void *a, const void *b, void *unused);
void NoteAccess();
void NoteUpdate();
// Get underlying raw cache database record.
nsresult GetRecord(nsINetDataCacheRecord* *aRecord);
nsresult GetRecordID(PRInt32 *aRecordID);
nsresult Evict(PRUint32 aTruncatedContentLength);
nsresult GetFileSpec(nsIFileSpec* *aFileSpec);
void NoteDownloadTime(PRTime start, PRTime end);
// placement new for arena-allocation
void *operator new (size_t aSize, nsIArena *aArena);
friend class nsReplacementPolicy;
friend class nsCacheManager;
friend class StreamAsFile;
friend class nsCacheEntryChannel;
friend class CacheOutputStream;
friend class InterceptStreamListener;
private:
nsCachedNetData() {};
virtual ~nsCachedNetData() {};
// Initialize internal fields of this nsCachedNetData instance from the
// underlying raw cache database record.
nsresult Deserialize(bool aDeserializeFlags);
// Notify stream-as-file observers about change in cache entry status
nsresult Notify(PRUint32 aMessage, nsresult aError);
// Add/Remove stream-as-file observers
nsresult AddObserver(nsIStreamAsFile *aStreamAsFile, nsIStreamAsFileObserver* aObserver);
nsresult RemoveObserver(nsIStreamAsFileObserver* aObserver);
// Mark cache entry to indicate a write out to the cache database is required
void SetDirty() { mFlags |= DIRTY; }
nsresult Resurrect(nsINetDataCacheRecord *aRecord);
nsresult CommitFlags();
CacheMetaData* FindTaggedMetaData(const char* aTag, PRBool aCreate);
private:
// List of nsIStreamAsFileObserver's that will receive notification events
// when the cache manager or a client desires to delete/truncate a cache
// entry file.
StreamAsFileObserverClosure* mObservers;
// Protocol-specific meta-data, opaque to the cache manager
CacheMetaData *mMetaData;
// Next in chain for a single bucket in the replacement policy hash table
// that maps from record ID to nsCachedNetData
nsCachedNetData* mNext;
// See flag bits, above
// NOTE: 16 bit member is combined with members below for
// struct packing efficiency. Do not change order of members!
PRUint16 mFlags;
protected:
// Number of nsCacheEntryChannels referring to this record
PRUint8 mChannelCount;
// Below members are statistics kept per cache-entry, used to decide how
// profitable it will be to evict a record from the cache relative to other
// existing records. Note: times are measured in *seconds* since the
// 1/1/70 epoch, same as a unix time_t.
// Number of accesses for this cache record
// NOTE: 8 bit member is combined with members above for
// struct packing efficiency. Do not change order of members!
PRUint8 mNumAccesses;
// A reference to the underlying, raw cache database record, either as a
// pointer to an in-memory object or as a database record identifier
union {
nsINetDataCacheRecord* mRecord;
// Database record ID of associated cache record. See
// nsINetDataCache::GetRecordByID().
PRInt32 mRecordID;
};
// Weak link to parent cache
nsINetDataCache* mCache;
// Length of stored content, which may be less than storage consumed if
// compression is used
PRUint32 mLogicalLength;
// Most recent cache entry access times, used to compute access frequency
PRUint32 mAccessTime[MAX_K];
// We use modification time of the original document for replacement policy
// computations, i.e. to compute a document's age, but if we don't know it,
// we use the time that the document was last written to the cache.
union {
// Document modification time, if known.
PRUint32 mLastModifiedTime;
// Time of last cache update for this doc
PRUint32 mLastUpdateTime;
};
union {
// Time until which document is fresh, i.e. does not have to be validated
// with server and, therefore, data in cache is guaranteed usable
PRUint32 mExpirationTime;
// Heuristic time at which cached document is likely to be out-of-date
// with respect to canonical copy on server. Used for cache replacement
// policy, not for validation.
PRUint32 mStaleTime;
};
// Download time per byte, measure roughly in units of KB/s
float mDownloadRate;
// Heuristic estimate of cache entry future benefits, based on above values
float mProfit;
};
#endif // _nsCachedNetData_h_

View File

@@ -1,658 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
#include "nsReplacementPolicy.h"
#include "nsCachedNetData.h"
#include "nsQuickSort.h"
#include "nsIAllocator.h"
#include "nsIEnumerator.h"
#include "prtime.h"
#include "prbit.h"
#include "nsCOMPtr.h"
#include <math.h>
// Constant used to estimate frequency of access to a document based on size
#define CACHE_CONST_B 1.35
// A cache whose space is managed by this replacement policy
class nsReplacementPolicy::CacheInfo {
public:
CacheInfo(nsINetDataCache* aCache):mCache(aCache),mNext(0) {}
nsINetDataCache* mCache;
CacheInfo* mNext;
};
nsReplacementPolicy::nsReplacementPolicy()
: mRankedEntries(0), mCaches(0), mRecordsRemovedSinceLastRanking(0),
mNumEntries(0), mCapacityRankedEntriesArray(0), mLastRankTime(0) {}
nsReplacementPolicy::~nsReplacementPolicy()
{
if (mRankedEntries)
nsAllocator::Free(mRankedEntries);
if (mMapRecordIdToEntry)
nsAllocator::Free(mMapRecordIdToEntry);
}
nsresult
nsReplacementPolicy::Init(PRUint32 aMaxCacheEntries)
{
nsresult rv;
rv = NS_NewHeapArena(getter_AddRefs(mArena), sizeof(nsCachedNetData) * 32);
if (NS_FAILED(rv)) return rv;
mMaxEntries = aMaxCacheEntries;
mHashArrayLength = PR_CeilingLog2(aMaxCacheEntries) >> 3;
size_t numBytes = mHashArrayLength * sizeof(*mMapRecordIdToEntry);
mMapRecordIdToEntry = (nsCachedNetData**)nsAllocator::Alloc(numBytes);
if (!mMapRecordIdToEntry)
return NS_ERROR_OUT_OF_MEMORY;
nsCRT::zero(mMapRecordIdToEntry, numBytes);
return NS_OK;
}
nsresult
nsReplacementPolicy::AddCache(nsINetDataCache *aCache)
{
CacheInfo *cacheInfo = new CacheInfo(aCache);
if (!cacheInfo)
return NS_ERROR_OUT_OF_MEMORY;
cacheInfo->mNext = mCaches;
mCaches = cacheInfo;
return NS_OK;
}
PRUint32
nsReplacementPolicy::HashRecordID(PRInt32 aRecordID)
{
return ((aRecordID >> 16) ^ aRecordID) & (mHashArrayLength - 1);
}
nsCachedNetData*
nsReplacementPolicy::FindCacheEntryByRecordID(PRInt32 aRecordID, nsINetDataCache *aCache)
{
nsresult rv;
nsCachedNetData* cacheEntry;
PRUint32 bucket = HashRecordID(aRecordID);
cacheEntry = mMapRecordIdToEntry[bucket];
for (;cacheEntry; cacheEntry = cacheEntry->mNext) {
PRInt32 recordID;
rv = cacheEntry->GetRecordID(&recordID);
if (NS_FAILED(rv))
continue;
if ((recordID == aRecordID) && (cacheEntry->mCache == aCache))
return cacheEntry;
}
return 0;
}
// Add a cache entry to the hash table that maps record ID to entries
void
nsReplacementPolicy::AddCacheEntry(nsCachedNetData* aCacheEntry, PRInt32 aRecordID)
{
nsCachedNetData** cacheEntryp;
PRUint32 bucket = HashRecordID(aRecordID);
cacheEntryp = &mMapRecordIdToEntry[bucket];
while (*cacheEntryp)
cacheEntryp = &(*cacheEntryp)->mNext;
*cacheEntryp = aCacheEntry;
aCacheEntry->mNext = 0;
}
// Delete a cache entry from the hash table that maps record ID to entries
nsresult
nsReplacementPolicy::DeleteCacheEntry(nsCachedNetData* aCacheEntry)
{
nsresult rv;
PRInt32 recordID;
rv = aCacheEntry->GetRecordID(&recordID);
if (NS_FAILED(rv)) return rv;
PRUint32 bucket = HashRecordID(recordID);
nsCachedNetData** cacheEntryp;
cacheEntryp = &mMapRecordIdToEntry[bucket];
while (*cacheEntryp) {
if (*cacheEntryp == aCacheEntry) {
*cacheEntryp = aCacheEntry->mNext;
return NS_OK;
}
cacheEntryp = &(*cacheEntryp)->mNext;
}
NS_ASSERTION(0, "hash table inconsistency");
return NS_ERROR_FAILURE;
}
nsresult
nsReplacementPolicy::AddAllRecordsInCache(nsINetDataCache *aCache)
{
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> iterator;
nsCOMPtr<nsISupports> iSupports;
nsCOMPtr<nsINetDataCacheRecord> record;
rv = aCache->NewCacheEntryIterator(getter_AddRefs(iterator));
if (!NS_SUCCEEDED(rv)) return rv;
while (1) {
PRBool notDone;
rv = iterator->HasMoreElements(&notDone);
if (NS_FAILED(rv)) return rv;
if (!notDone)
break;
rv = iterator->GetNext(getter_AddRefs(iSupports));
if (!NS_SUCCEEDED(rv)) return rv;
record = do_QueryInterface(iSupports);
rv = AssociateCacheEntryWithRecord(record, aCache, 0);
if (!NS_SUCCEEDED(rv)) return rv;
}
return NS_OK;
}
// Get current time and convert to seconds since the epoch
static PRUint32
now32()
{
double nowFP;
PRInt64 now64 = PR_Now();
LL_L2D(nowFP, now64);
PRUint32 now = (PRUint32)(nowFP * 1e-6);
return now;
}
void
nsCachedNetData::NoteDownloadTime(PRTime start, PRTime end)
{
double startFP, endFP, rate, duration;
LL_L2D(startFP, start);
LL_L2D(endFP, end);
duration = endFP - startFP;
// Sanity-check
if (!duration)
return;
// Compute download rate in kB/s
rate = mLogicalLength / (duration * (1e-6 /1024.0));
// Exponentially smooth download rate
const double alpha = 0.5;
mDownloadRate = (float)(mDownloadRate * alpha + rate * (1.0 - alpha));
}
// 1 hour
#define MIN_HALFLIFE (60 * 60)
// 1 week
#define TYPICAL_HALFLIFE (7 * 24 * 60 * 60)
/**
* Estimate the profit that would be lost if the given cache entry was evicted
* from the cache. Profit is defined as the future expected download delay per
* byte of cached content. The profit computation is made based on projected
* frequency of access, prior download performance and a heuristic staleness
* criteria. The technique used is a variation of that described in the
* following paper:
*
* "A Case for Delay-Conscious Caching of Web Documents"
* http://www.bell-labs.com/user/rvingral/www97.html
*
* Briefly, expected profit is:
*
* (projected frequency of access) * (download time per byte) * (probability freshness)
*/
void
nsCachedNetData::ComputeProfit(PRUint32 aNow)
{
PRUint32 K, now;
if (aNow)
now = aNow;
else
now = now32();
K = PR_MIN(MAX_K, mNumAccesses);
if (!K) {
mProfit = 0;
return;
}
// Compute time, in seconds, since k'th most recent access
double timeSinceKthAccess = now - mAccessTime[K - 1];
if (timeSinceKthAccess <= 0.0) // Sanity check
timeSinceKthAccess = 1.0;
// Estimate frequency of future document access based on past
// access frequency
double frequencyAccess = K / timeSinceKthAccess;
// If we don't have much historical data on access frequency
// use a heuristic based on document size as an estimate
if (mLogicalLength) {
if (K == 1) {
frequencyAccess /= pow(mLogicalLength, CACHE_CONST_B);
} else if (K == 2) {
frequencyAccess /= pow(mLogicalLength, CACHE_CONST_B / 2);
}
}
// Estimate likelihood that data in cache is fresh, i.e.
// that it corresponds to the document on the server
double probabilityFreshness;
PRInt32 halfLife, age, docTime;
bool potentiallyStale;
docTime = GetFlag(LAST_MODIFIED_KNOWN) ? mLastModifiedTime : mLastUpdateTime;
age = now - docTime;
probabilityFreshness = 1.0; // Optimistic
if (GetFlag(EXPIRATION_KNOWN)) {
potentiallyStale = now > mExpirationTime;
halfLife = mExpirationTime - mLastModifiedTime;
} else if (GetFlag(STALE_TIME_KNOWN)) {
potentiallyStale = true;
halfLife = mStaleTime - docTime;
} else {
potentiallyStale = true;
halfLife = TYPICAL_HALFLIFE;
}
if (potentiallyStale) {
if (halfLife < MIN_HALFLIFE)
halfLife = MIN_HALFLIFE;
probabilityFreshness = pow(0.5, (double)age / (double)halfLife);
}
mProfit = (float)(frequencyAccess * probabilityFreshness * mDownloadRate);
}
// Number of entries to grow mRankedEntries array when it's full
#define STATS_GROWTH_INCREMENT 256
// Sorting predicate for NS_Quicksort
int
nsCachedNetData::Compare(const void *a, const void *b, void *unused)
{
nsCachedNetData* entryA = (nsCachedNetData*)a;
nsCachedNetData* entryB = (nsCachedNetData*)b;
// Percolate deleted or empty entries to the end of the mRankedEntries
// array, so that they can be recycled.
if (!entryA || entryA->GetFlag(RECYCLED)) {
if (!entryB || entryB->GetFlag(RECYCLED))
return 0;
else
return +1;
}
if (!entryB || entryB->GetFlag(RECYCLED))
return -1;
// Evicted entries (those with no content data) and active entries (those
// currently being updated) are collected towards the end of the sorted
// array just prior to the deleted cache entries, since evicted entries
// can't be re-evicted.
if (entryA->GetFlag(UPDATE_IN_PROGRESS)) {
if (entryB->GetFlag(UPDATE_IN_PROGRESS))
return 0;
else
return +1;
}
if (entryB->GetFlag(UPDATE_IN_PROGRESS))
return -1;
PRUint16 Ka = PR_MIN(MAX_K, entryA->mNumAccesses);
PRUint16 Kb = PR_MIN(MAX_K, entryB->mNumAccesses);
// Order cache entries by the number of times they've been accessed
if (Ka < Kb)
return -1;
if (Ka > Kb)
return +1;
/*
* Among records that have been accessed an equal number of times, order
* them by profit.
*/
if (entryA->mProfit > entryB->mProfit)
return +1;
if (entryA->mProfit < entryB->mProfit)
return -1;
return 0;
}
/**
* Rank cache entries in terms of their elegibility for eviction.
*/
nsresult
nsReplacementPolicy::RankRecords()
{
PRUint32 i, now;
// Add all cache records if this is the first ranking
if (!mLastRankTime) {
nsresult rv;
CacheInfo *cacheInfo;
cacheInfo = mCaches;
while (cacheInfo) {
rv = AddAllRecordsInCache(cacheInfo->mCache);
if (NS_FAILED(rv)) return rv;
cacheInfo = cacheInfo->mNext;
}
}
// Get current time and convert to seconds since the epoch
now = now32();
// Recompute profit for every known cache record, except deleted ones
for (i = 0; i < mNumEntries; i++) {
nsCachedNetData* entry = mRankedEntries[i];
if (entry && !entry->GetFlag(nsCachedNetData::RECYCLED))
entry->ComputeProfit(now);
}
NS_QuickSort(mRankedEntries, mNumEntries, sizeof *mRankedEntries,
nsCachedNetData::Compare, 0);
mNumEntries -= mRecordsRemovedSinceLastRanking;
mRecordsRemovedSinceLastRanking = 0;
mLastRankTime = now;
return NS_OK;
}
// A heuristic policy to avoid the cost of re-ranking cache records by
// profitability every single time space must be made available in the cache.
void
nsReplacementPolicy::MaybeRerankRecords()
{
// Rank at most once per minute
PRUint32 now = now32();
if ((now - mLastRankTime) >= 60)
RankRecords();
}
void
nsReplacementPolicy::CompactRankedEntriesArray()
{
if (mRecordsRemovedSinceLastRanking || !mLastRankTime)
RankRecords();
}
nsresult
nsReplacementPolicy::CheckForTooManyCacheEntries()
{
if (mCapacityRankedEntriesArray == mMaxEntries) {
return DeleteOneEntry(0);
} else {
nsresult rv;
CacheInfo *cacheInfo;
cacheInfo = mCaches;
while (cacheInfo) {
PRUint32 numEntries, maxEntries;
rv = cacheInfo->mCache->GetNumEntries(&numEntries);
if (NS_FAILED(rv)) return rv;
rv = cacheInfo->mCache->GetMaxEntries(&maxEntries);
if (NS_FAILED(rv)) return rv;
if (numEntries == maxEntries)
return DeleteOneEntry(cacheInfo->mCache);
cacheInfo = cacheInfo->mNext;
}
}
return NS_OK;
}
/**
* Create a new association between a low-level cache database record and a
* cache entry. Add the entry to the set of entries eligible for eviction from
* the cache. This would typically be done when the cache entry is created.
*/
nsresult
nsReplacementPolicy::AssociateCacheEntryWithRecord(nsINetDataCacheRecord *aRecord,
nsINetDataCache* aCache,
nsCachedNetData** aResult)
{
nsCachedNetData* cacheEntry;
nsresult rv;
// First, see if the record is already known to the replacement policy
PRInt32 recordID;
rv = aRecord->GetRecordID(&recordID);
if (NS_FAILED(rv)) return rv;
cacheEntry = FindCacheEntryByRecordID(recordID, aCache);
if (cacheEntry) {
if (aResult) {
if (cacheEntry->GetFlag(nsCachedNetData::DORMANT))
cacheEntry->Resurrect(aRecord);
NS_ADDREF(cacheEntry);
*aResult = cacheEntry;
}
return NS_OK;
}
// Compact the array of cache entry statistics, so that free entries appear
// at the end, for possible reuse.
if (mNumEntries && (mNumEntries == mCapacityRankedEntriesArray))
CompactRankedEntriesArray();
// If compaction doesn't yield available entries in the
// mRankedEntries array, then extend the array.
if (mNumEntries == mCapacityRankedEntriesArray) {
PRUint32 newCapacity;
rv = CheckForTooManyCacheEntries();
if (NS_FAILED(rv)) return rv;
newCapacity = mCapacityRankedEntriesArray + STATS_GROWTH_INCREMENT;
if (newCapacity > mMaxEntries)
newCapacity = mMaxEntries;
nsCachedNetData** newRankedEntriesArray;
PRUint32 numBytes = sizeof(nsCachedNetData*) * newCapacity;
newRankedEntriesArray =
(nsCachedNetData**)nsAllocator::Realloc(mRankedEntries, numBytes);
if (!newRankedEntriesArray)
return NS_ERROR_OUT_OF_MEMORY;
mRankedEntries = newRankedEntriesArray;
mCapacityRankedEntriesArray = newCapacity;
PRUint32 i;
for (i = mNumEntries; i < newCapacity; i++)
mRankedEntries[i] = 0;
}
// Recycle the record after the last in-use record in the array
nsCachedNetData *entry = mRankedEntries[mNumEntries];
NS_ASSERTION(!entry || !entry->GetFlag(nsCachedNetData::RECYCLED),
"Only deleted cache entries should appear at end of array");
if (!entry) {
entry = new(mArena) nsCachedNetData;
if (!entry)
return NS_ERROR_OUT_OF_MEMORY;
mRankedEntries[mNumEntries] = entry;
} else {
// Clear out recycled data structure
nsCRT::zero(entry, sizeof(*entry));
}
entry->Init(aRecord, aCache);
AddCacheEntry(entry, recordID);
// Add one reference to the cache entry from the cache manager
NS_ADDREF(entry);
if (aResult) {
// And one reference from our caller
NS_ADDREF(entry);
*aResult = entry;
}
mNumEntries++;
return NS_OK;
}
nsresult
nsReplacementPolicy::GetCachedNetData(const char* cacheKey, PRUint32 cacheKeyLength,
nsINetDataCache* aCache,
nsCachedNetData** aResult)
{
nsresult rv;
nsCOMPtr<nsINetDataCacheRecord> record;
rv = aCache->GetCachedNetData(cacheKey, cacheKeyLength,
getter_AddRefs(record));
if (NS_FAILED(rv)) return rv;
return AssociateCacheEntryWithRecord(record, aCache, aResult);
}
/**
* Delete the least desirable record from the cache database. This is used
* when the addition of another record would exceed either the cache manager or
* the cache's maximum permitted number of records.
*/
nsresult
nsReplacementPolicy::DeleteOneEntry(nsINetDataCache *aCache)
{
PRUint32 i;
nsresult rv;
nsCachedNetData *entry;
i = 0;
while (1) {
MaybeRerankRecords();
for (; i < mNumEntries; i++) {
entry = mRankedEntries[i];
if (!entry || entry->GetFlag(nsCachedNetData::RECYCLED))
continue;
if (!aCache || (entry->mCache == aCache))
break;
}
// Report error if no record found to delete
if (i == mNumEntries)
return NS_ERROR_FAILURE;
rv = entry->Delete();
if (NS_SUCCEEDED(rv)) {
rv = DeleteCacheEntry(entry);
return rv;
}
}
}
nsresult
nsReplacementPolicy::GetStorageInUse(PRUint32* aStorageInUse)
{
nsresult rv;
CacheInfo *cacheInfo;
*aStorageInUse = 0;
cacheInfo = mCaches;
while (cacheInfo) {
PRUint32 cacheStorage;
rv = cacheInfo->mCache->GetStorageInUse(&cacheStorage);
if (NS_FAILED(rv)) return rv;
*aStorageInUse += cacheStorage;
cacheInfo = cacheInfo->mNext;
}
return NS_OK;
}
/**
* Delete the least desirable records from the cache until the occupancy of the
* cache has been reduced by the given number of KB. This is used when the
* addition of more cache data would exceed the cache's capacity.
*/
nsresult
nsReplacementPolicy::Evict(PRUint32 aTargetOccupancy)
{
PRUint32 i;
nsCachedNetData *entry;
nsresult rv;
PRUint32 occupancy;
PRInt32 truncatedLength;
nsCOMPtr<nsINetDataCacheRecord> record;
MaybeRerankRecords();
for (i = 0; i < mNumEntries; i++) {
rv = GetStorageInUse(&occupancy);
if (!NS_SUCCEEDED(rv)) return rv;
if (occupancy <= aTargetOccupancy)
return NS_OK;
entry = mRankedEntries[i];
// Skip deleted/empty cache entries and ones that have already been evicted
if (!entry || entry->GetFlag(nsCachedNetData::UNEVICTABLE))
continue;
if (entry->GetFlag(nsCachedNetData::ALLOW_PARTIAL)) {
rv = entry->GetRecord(getter_AddRefs(record));
if (NS_FAILED(rv))
continue;
PRUint32 contentLength;
rv = record->GetStoredContentLength(&contentLength);
if (NS_FAILED(rv))
continue;
// Additional cache storage required, in KB
PRUint32 storageToReclaim = (occupancy - aTargetOccupancy) << 10;
truncatedLength = (PRInt32)(contentLength - storageToReclaim);
if (truncatedLength < 0)
truncatedLength = 0;
} else {
truncatedLength = 0;
}
rv = entry->Evict(truncatedLength);
}
return NS_ERROR_FAILURE;
}

View File

@@ -1,136 +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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Furman, fur@netscape.com
*/
/**
* This class manages one or more caches that share a storage resource, e.g. a
* file cache and a flat-database cache might each occupy space on the disk and
* they would share a single instance of nsReplacementPolicy. The replacement
* policy heuristically chooses which cache entries to evict when storage is
* required to accommodate incoming cache data.
*/
#ifndef _nsReplacementPolicy_h_
#define _nsReplacementPolicy_h_
#include "nscore.h"
#include "nsISupportsUtils.h"
#include "nsINetDataCache.h"
#include "nsICachedNetData.h"
#include "nsIArena.h"
#include "nsCOMPtr.h"
#include "nsHashtable.h"
class nsCachedNetData;
struct PL_HashTable;
/**
* This private class is responsible for implementing the network data cache's
* replacement policy, i.e. it decides which cache data should be evicted to
* make room for new incoming data.
*/
class nsReplacementPolicy {
public:
nsReplacementPolicy();
~nsReplacementPolicy();
protected:
nsresult Init(PRUint32 aMaxCacheEntries);
nsresult AddCache(nsINetDataCache *aCache);
nsresult GetCachedNetData(const char* cacheKey, PRUint32 cacheKeyLength,
nsINetDataCache* aCache,
nsCachedNetData** aResult);
nsresult GetStorageInUse(PRUint32* aNumKBytes);
friend class nsCacheManager;
private:
nsresult RankRecords();
void MaybeRerankRecords();
void CompactRankedEntriesArray();
nsresult DeleteOneEntry(nsINetDataCache* aCache);
nsresult Evict(PRUint32 aTargetOccupancy);
nsCachedNetData* FindCacheEntryByRecordID(PRInt32 aRecordID, nsINetDataCache *aCache);
void AddCacheEntry(nsCachedNetData* aCacheEntry, PRInt32 aRecordID);
nsresult DeleteCacheEntry(nsCachedNetData* aCacheEntry);
PRUint32 HashRecordID(PRInt32 aRecordID);
nsresult AssociateCacheEntryWithRecord(nsINetDataCacheRecord *aRecord,
nsINetDataCache* aCache,
nsCachedNetData** aResult);
nsresult AddAllRecordsInCache(nsINetDataCache *aCache);
nsresult CheckForTooManyCacheEntries();
class CacheInfo;
private:
// Growable array of pointers to individual cache entries; It is sorted by
// profitability, such that low-numbered array indices refer to cache
// entries that are the least profitable to retain. New cache entries are
// added to the end of the array. Deleted cache entries are specially
// marked and percolate to the end of the array for recycling whenever
// mRankedEntries is sorted. Evicted cache entries (those with no
// associated content data) are retained for the purpose of improving the
// replacement policy efficacy, and are percolated towards the end of the
// array, just prior to the deleted cache entries.
//
// The array is not in sorted order 100% of the time; For efficiency
// reasons, sorting is only done when heuristically deemed necessary.
nsCachedNetData** mRankedEntries;
// Hash table buckets to map Record ID to cache entry. We use this instead
// of a PL_HashTable to reduce storage requirements
nsCachedNetData** mMapRecordIdToEntry;
// Length of mMapRecordIdToEntry array
PRUint32 mHashArrayLength;
// Linked list of caches that share this replacement policy
CacheInfo* mCaches;
// Allocation area for cache entry (nsCachedNetData) instances
nsCOMPtr<nsIArena> mArena;
// Bookkeeping
PRUint32 mRecordsRemovedSinceLastRanking;
// Maximum permitted length of mRankedEntries array
PRUint32 mMaxEntries;
// Number of occupied slots in mRankedEntries array
PRUint32 mNumEntries;
// Capacity of mRankedEntries array
PRUint32 mCapacityRankedEntriesArray;
// Time at which cache entries were last ranked by profitability
PRUint32 mLastRankTime;
};
#endif // _nsReplacementPolicy_h_

View File

@@ -1,39 +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
EXPORTS = \
nsICacheManager.h \
nsICacheObject.h \
nsICachePref.h \
nsICacheModule.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
include $(topsrcdir)/config/rules.mk

View File

@@ -1,41 +0,0 @@
#!gmake
#
# 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):
MODULE = nkcache
DEPTH = ..\..\..
include <$(DEPTH)/config/config.mak>
EXPORTS = \
$(NULL)
XPIDLSRCS = \
.\nsICachedNetData.idl \
.\nsINetDataCacheManager.idl \
.\nsINetDataCache.idl \
.\nsINetDataCacheRecord.idl \
.\nsINetDataDiskCache.idl \
.\nsIStreamAsFile.idl \
$(NULL)
include <$(DEPTH)/config/rules.mak>

View File

@@ -1,229 +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):
*/
#include "nsrootidl.idl"
#include "nsISupports.idl"
interface nsIFileSpec;
interface nsIURI;
interface nsIObserver;
interface nsIChannel;
interface nsINetDataCache;
interface nsINetDataCacheRecord;
interface nsILoadGroup;
interface nsIStreamListener;
/**
* The nsICachedNetData interface represents a single entry in a database that
* caches data retrieved from the network. This interface is implemented by the
* cache manager on top of the low-level nsINetDataCacheRecord and
* nsINetDataCache interfaces that are implemented by the database.
*
* Each cache record may contain both content and metadata. The content may
* be, for example, GIF image data or HTML, and it is accessed through
* nsIChannel's streaming API. The opaque metadata, which may contain HTTP
* headers among other things, is stored as a byte array. Each entry in the
* cache is indexed by two different keys: a record id number and a key created
* by combining the URI with a "secondary key", e.g. HTTP post data.
*
* @See nsINetDataCacheRecord
* @See nsINetDataCache
* @See nsINetDataDiskCache
* @See nsINetDataCacheManager
*/
[scriptable, uuid(6aeb2a40-6d43-11d3-90c8-000064657374)]
interface nsICachedNetData : nsISupports
{
/**
* String form of the URI provided as an argument to the call to
* nsINetDataCacheManager::GetCachedNetData() that created this record.
*/
readonly attribute string uriSpec;
/**
* Getter for the opaque secondary database key provided as an argument to
* the call to nsINetDataCacheManager::GetCachedNetData() that created this
* record.
*/
void getSecondaryKey(out unsigned long length,
[retval, size_is(length)] out string secondaryKey);
/**
* This flag may be set by a protocol handler to indicate that it supports
* partial fetching of data. In that case, the cache manager is permitted
* to truncate the entry's content to accommodate incoming data for other
* cache entries rather than deleting it wholesale.
*/
attribute boolean allowPartial;
/**
* This flag indicates that the write stream supplying content data for the
* cache did not complete normally and, therefore, the content may be
* truncated.
*/
readonly attribute boolean partialFlag;
/**
* This flag can be set and cleared by a protocol handler as a form of
* self-notification, so as to avoid race conditions in which a protocol
* handler issues two identical network requests to fill the same cache
* entry. The cache manager itself largely ignores this flag.
*/
attribute boolean updateInProgress;
/**
* inUse is set if any existing channels are associated with this cache
* entry or if the updateInProgess flag is set. This can be used to
* prevent writing to a cache entry by a protocol handler if it's being
* read or written elsewhere.
*/
readonly attribute boolean inUse;
/**
* Date/time that the document was last stored on the origin server, as
* supplied by the protocol handler. This value is used as input to the
* cache replacement policy, i.e. it is not used for validation. If the
* protocol can't supply a last-modified time, this attribute should remain
* unset. When unset, the value of this attribute is zero.
*
* FIXME: Should use nsIDateTime interface, once it's created
* instead of PRTime, for improved scriptability ?
*/
attribute PRTime lastModifiedTime;
/**
* Supplied by the protocol handler, the expirationTime attribute specifies
* the time until which the document is guaranteed fresh, i.e. the document
* does not have to be validated with the server and, therefore, any data
* in cache is definitely usable. The value of this attribute serves as a
* hint to the cache replacement policy. Only one of either staleTime or
* expirationTime may be set for a single cache record. When unset, the
* value of this attribute is zero.
*/
attribute PRTime expirationTime;
/**
* Date/time supplied by the protocol handler, at which point the content
* is *likely* to be stale, i.e. the data in the cache may be out-of-date
* with respect to the data on the server. This heuristic date does not
* necessarily correspond to the HTTP Expires header, as it does not
* determine when cached network data must be validated with the origin
* server, but only serves as a hint to the cache replacement policy. Only
* one of either staleTime or expirationTime may be set for a single cache
* record. When unset, the value of this attribute is zero.
*/
attribute PRTime staleTime;
/**
* Date/time of last access of the data in this cache record, as determined
* by the cache manager.
*/
readonly attribute PRTime lastAccessTime;
/**
* Number of times this record has been accessed since it was first stored.
*/
readonly attribute PRUint16 numberAccesses;
/**
* Accessor methods for opaque meta-data which can be read and updated
* independently of the content data.
*
* The aTag argument can be used to accommodate multiple clients of the
* cache API, each of which wants to store its own private meta-data into
* the cache. For example, there could be a "headers" tag that the HTTP
* protocol handler uses to store http response headers and a "image size"
* tag used to store the image dimensions of a GIF file. The aData
* argument refers to an opaque blob of arbitrary bytes.
*
* IMPORTANT: If aData does not contain byte-oriented data, i.e. it's not a
* string, the contents of aData must be byte-swapped by the,
* caller, so as to make the cache files endian-independent.
*/
void getAnnotation(in string aTag,
out PRUint32 aLength, [size_is(aLength), retval] out string aData);
void setAnnotation(in string aTag,
in PRUint32 aLength, [size_is(aLength)] in string aData);
/**
* As a getter, return the number of content bytes stored in the cache,
* i.e. via the nsIChannel streaming APIs. This may be less than the
* complete content length if a partial cache fill occurred. The cached
* content can be truncated by setting the value of this attribute. The
* value of the attribute represents a logical, not a physical, length. If
* compression has been used, the content may consume less storage than
* indicated by this attribute.
*
* When this attribute is set to zero the associated cache disk file, if
* any, should be deleted.
*/
attribute PRUint32 storedContentLength;
/**
* Notify any observers associated with this cache entry of the deletion
* request. If all observers drop their reference to the cache entry,
* proceed to delete the underlying cache database record and associated
* content storage.
*/
void delete();
/**
* Flush any changes in this entry's data to the cache database. This
* method will automatically be called when the last reference to the cache
* is dropped, but it can also be called explicitly for a synchronous
* effect.
*/
void commit();
/**
* Parent container cache for this entry.
*/
readonly attribute nsINetDataCache cache;
/**
* Create a channel for reading or writing a stream of content into the
* entry. It is expected that many of the nsIChannel methods return
* NS_NOT_IMPLEMENTED, including:
*
* + GetURI()
* + GetContentType()
* + GetContentLength()
*
* Though nsIChannel provides for both async and synchronous I/O APIs, both
* may not be implemented. Only AsyncRead() and OpenOutputStream() is
* required. The aProxyChannel argument allows another channel to be
* specified as the proffered argument to nsIStreamListener methods rather
* than the cache's own channel.
*/
nsIChannel newChannel(in nsILoadGroup aLoadGroup,
in nsIChannel aProxyChannel);
/**
* This method can be used by a caching protocol handler to store data in
* the cache by forking an asynchronous read stream so that it is
* simultaneously sent to a requester and written into the cache. This
* method implicitly sets the updateInProgress flag, if it has not already
* been set.
*/
nsIStreamListener interceptAsyncRead(in nsIStreamListener aOriginalListener,
in PRUint32 aStartOffset);
};

View File

@@ -1,143 +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):
*/
#include "nsISupports.idl"
interface nsIURI;
interface nsINetDataCacheRecord;
interface nsISimpleEnumerator;
interface nsIFileSpec;
/**
* The nsINetDataCache defines the low-level API for a network-data
* cache, used to cache the responses to network retrieval commands.
* This interface, along with nsINetDataCacheRecord, is implemented by
* the memory cache, the file cache and, optionally, by some extension
* caches. This interface is essentially a pseudo-private API for the
* cache manager. Other clients should never use this interface.
*
* Each cache entry may contain both content, e.g. GIF image data, and
* associated metadata, e.g. HTTP headers. Each entry is indexed by two
* different keys: a record id number and a key created by combining the URI
* with a "secondary key", e.g. HTTP post data.
*
* The nsINetDataCache interface is agnostic as to where the data is
* stored and whether the storage is volatile or persistent. The
* memory cache, any disk caches and any extension caches must all
* implement this interface.
*
*/
[scriptable, uuid(ccfc58c0-6dde-11d3-90c8-000064657374)]
interface nsINetDataCache : nsISupports
{
/**
* Human-readable description of the cache module, e.g. "Disk Cache"
*/
readonly attribute wstring description;
/**
* Returns true if cached data is available for the given opaque key,
* even if only partial data is stored.
*/
boolean contains([size_is(length)] in string key, in PRUint32 length);
/**
* Fetch the cache entry record for the given opaque key. If one does not
* exist, create a new, empty record.
*/
nsINetDataCacheRecord getCachedNetData([size_is(length)] in string key,
in PRUint32 length);
/**
* Fetch the cache entry record for the given URI using the record ID as a key.
*/
nsINetDataCacheRecord getCachedNetDataByID(in PRInt32 RecordID);
/**
* False indicates that this cache is entirely bypassed.
*/
attribute boolean enabled;
/**
* Constants for flags attribute, below
*/
// Used for extension caches, e.g. a CD-ROM cache
const long READ_ONLY = 1 << 0;
// One of these bits must be set
const long MEMORY_CACHE = 1 << 1;
const long FLAT_FILE_CACHE = 1 << 2;
const long FILE_PER_URL_CACHE = 1 << 3;
/**
* See constants defined above.
*/
readonly attribute PRUint32 flags;
/**
* Total number of URI entries stored in the cache.
*/
readonly attribute PRUint32 numEntries;
/**
* Maximum number of URI entries that may be stored in the cache.
*/
readonly attribute PRUint32 maxEntries;
/**
* Enumerate the URI entries stored in the cache.
*/
nsISimpleEnumerator newCacheEntryIterator();
/**
* Contains a reference to the next cache in search order. For the memory
* cache, this attribute always references the disk cache. For the disk
* cache, it contains a reference to the first extension cache.
*/
attribute nsINetDataCache nextCache;
/**
* An estimate of the amount of storage occupied by the cache, in kB.
* Actual use may be slightly higher than reported due to cache overhead
* and heap fragmentation (in the memory cache) or block quantization (in
* the disk cache).
*/
readonly attribute PRUint32 storageInUse;
/**
* Remove all entries from a writable cache. This could be used, for
* example, after a guest ends a browser session. This is equivalent to
* setting the cache's Capacity to zero, except that all cache entries,
* even those in active use, will be deleted. Also, any global cache
* database files will be deleted.
*/
void removeAll();
};
%{ C++
// ProgID prefix for Components that implement this interface
#define NS_NETWORK_CACHE_PROGID "component://netscape/network/cache"
#define NS_NETWORK_MEMORY_CACHE_PROGID NS_NETWORK_CACHE_PROGID "?name=memory-cache"
#define NS_NETWORK_FLAT_CACHE_PROGID NS_NETWORK_CACHE_PROGID "?name=flat-cache"
#define NS_NETWORK_FILE_CACHE_PROGID NS_NETWORK_CACHE_PROGID "?name=file-cache"
%}

View File

@@ -1,163 +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):
*/
#include "nsISupports.idl"
interface nsISimpleEnumerator;
interface nsICachedNetData;
interface nsINetDataCache;
interface nsINetDataDiskCache;
interface nsIURI;
interface nsIFileSpec;
/**
* The network-response cache manager is partly responsible for the caching of
* content and associated metadata that has been retrieved via the network.
* (The remaining responsibility for caching lies with individual network
* protocol handlers.)
*
* The cache manager supervises the actions of individual cache components,
* such as the memory cache, the disk cache and any extension caches, e.g. a
* read-only CD-ROM cache.
*
* @See nsINetDataCache
* @See nsICachedNetData
*/
[scriptable, uuid(71c8ab00-6d5c-11d3-90c8-000064657374)]
interface nsINetDataCacheManager : nsISupports
{
/**
* Flag for the GetCachedNetData() method: If set, the memory cache is
* neither searched nor will any data be stored into it. This might be
* appropriate, for example, with images, because they have their own
* cache for storing *decoded* images.
*/
const unsigned long BYPASS_MEMORY_CACHE = 1 << 0;
/**
* Flag for the GetCachedNetData() method: If set, the disk cache
* is neither searched nor will any be data stored into it.
* However, read-only extension caches may be searched. This
* might be used to avoid leaving persistent records of secure
* data.
*/
const unsigned long BYPASS_PERSISTENT_CACHE = 1 << 1;
/**
* Flag for the GetCachedNetData() method: If set, any stream
* content is stored in the cache as a single disk file. Content
* will not be cached in the memory cache nor is it cached in a
* flat-file cache database. This is used to implement the jar
* protocol handler and to provide the stream-as-file semantics
* required by the classic bowser plugin API.
*/
const unsigned long CACHE_AS_FILE = 1 << 2;
/**
* Fetch the cache entry record for the given URI. If one does not exist,
* create a new, empty record. The normal search order for caches is:
* + Memory cache
* + Disk cache
* + File cache (stream-as-file cache)
* + All extension caches
*
* When writing, data is typically stored in both the memory cache and the
* disk cache. Both the search order and this write policy can be modified by
* setting one or more of the flag argument bits, as defined above.
*
* The optionally-NULL secondaryKey argument can be used, e.g. for form
* post data or for HTTP headers in the case of HTTP.
*/
nsICachedNetData getCachedNetData(in string uri,
[size_is(secondaryKeyLength)] in string secondaryKey,
in PRUint32 secondaryKeyLength,
in PRUint32 flags);
/**
* Returns true if cached content is available for the given URI, even if
* only partial data is stored. The flags argument behaves the same as for
* the GetCachedNetData() method, above.
*/
boolean contains(in string uri,
[size_is(secondaryKeyLength)] in string secondaryKey,
in PRUint32 secondaryKeyLength,
in PRUint32 flags);
/**
* Total number of unexpired URI entries stored in all caches. This number
* does not take into account duplicate URIs, e.g. because the memory cache
* and the disk cache might each contain an entry for the same URI.
*/
readonly attribute PRUint32 numEntries;
/**
* Enumerate the unexpired URI entries stored in all caches. Some URIs may
* be enumerated more than once, e.g. because the the memory cache and the
* disk cache might each contain an entry for the same URI.
*/
nsISimpleEnumerator newCacheEntryIterator();
/*
* Enumerate all the loaded nsINetDataCache-implementing cache modules.
* The first module enumerated will be the memory cache, the second will be
* the disk cache, then the file cache, followed by all the extension
* caches, in search order.
*/
nsISimpleEnumerator newCacheModuleIterator();
/**
* Remove all entries from all writable caches. This could be used, for
* example, after a guest ends a browser session. This is equivalent to
* setting the DiskCacheCapacity to zero, except that all cache entries,
* even those in active use, will be deleted. Also, any global cache
* database files will be deleted.
*/
void RemoveAll();
/**
* The disk cache is made up of the file cache (for stream-as-file
* requests) and a (possibly independent) persistent cache that handles all
* other cache requests. This attribute sets/gets the combined capacity of
* these caches, measured in KBytes. Setting the capacity lower than the
* current amount of space currently in use may cause cache entries to be
* evicted from the cache to accomodate the requested capacity.
*/
attribute PRUint32 diskCacheCapacity;
/**
* This attribute sets/gets the capacity of the memory cache, measured in
* KBytes. Setting the capacity lower than the current amount of space
* currently in use may cause cache entries to be evicted from the cache to
* accomodate the requested capacity.
*/
attribute PRUint32 memCacheCapacity;
/**
* This attribute must be set before attempting to store into the disk cache.
*/
attribute nsIFileSpec diskCacheFolder;
};
%{ C++
// ProgID prefix for Components that implement this interface
#define NS_NETWORK_CACHE_MANAGER_PROGID NS_NETWORK_CACHE_PROGID "?name=manager"
%}

View File

@@ -1,125 +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):
*/
#include "nsISupports.idl"
#include "nsrootidl.idl"
interface nsIFileSpec;
interface nsIChannel;
interface nsINetDataCache;
/**
* The nsINetDataCacheRecord represents a single entry in a database that
* caches data retrieved from the network. On top of this low-level interface
* to the raw record data, the cache manager implements a higher-level record
* interface, nsICachedNetData. Each instance of nsINetDataCacheRecord is
* (internally) associated with a parent database, an instance of the
* nsINetDataCache interface. This interface is essentially a pseudo-private
* API for the cache manager. Other clients should never use this interface.
*
* Each cache record may contain both content and metadata. The content may
* be, for example, GIF image data or HTML, and it is accessed through
* nsIChannel's streaming API. The opaque metadata, which may contain HTTP
* headers among other things, is accessed as a contiguous byte array. Each
* entry in the cache is indexed by two different keys: a unique record id
* number, generated by the cache, and an opaque string. The latter contains
* the URI and other secondary key information, e.g. HTTP form post key/value
* pairs.
*
* The nsINetDataCacheRecord interface is agnostic as to where the data is
* stored and whether the storage is volatile or persistent. The memory cache,
* the disk cache, a flat-file cache and any read-only extension caches must
* all implement this interface.
*
* @See nsICachedNetData
* @See nsINetDataCache
* @See nsINetDataDiskCache
* @See nsINetDataCacheManager
*/
interface nsILoadGroup;
[scriptable, uuid(fdcdd6a0-7461-11d3-90ca-0040056a906e)]
interface nsINetDataCacheRecord : nsISupports
{
/**
* As far as the nsINetDataCacheRecord implementation is concerned, the
* cache entry database key is an opaque blob, but it's intended to contain
* both the URI and any secondary keys, such as HTTP post data.
*/
void getKey(out unsigned long length, [size_is(length), retval] out string key);
/**
* A persistent record number assigned by the cache which must be unique
* among all entries stored within the same cache. The record ID serves as
* an alternate key to the cache record. Providing that they satisfy the
* afforementioned uniqueness requirement, record IDs can be assigned any
* value by the database except that they may never be zero.
*/
readonly attribute PRInt32 recordID;
/**
* Opaque data which can be updated for each cache entry independently of
* the content data. This data is a combination of protocol-independent
* data provided by the cache manager and protocol-specific meta-data,
* e.g. HTTP headers.
*/
void getMetaData(out PRUint32 length, [size_is(length), retval] out string metaData);
void setMetaData(in PRUint32 length, [size_is(length)] in string data);
/**
* Number of content bytes stored in the cache, i.e. via the nsIChannel
* streaming APIs. This may be less than the complete content length if a
* partial cache fill occurred. Additionally, the cached content can be
* truncated by reducing the value of this attribute. When this attribute
* is set to zero the associated cache disk file, if any, should be
* deleted.
*/
attribute PRUint32 storedContentLength;
/**
* Delete this cache entry and its associated content.
*/
void delete();
/**
* Create a channel for reading or writing a stream of content into the
* entry. However, many of the nsIChannel methods may return
* NS_NOT_IMPLEMENTED, including:
*
* + GetURI()
* + GetContentType()
* + GetContentLength()
*/
nsIChannel newChannel(in nsILoadGroup loadGroup);
/**
* If a cache is implemented such that it stores each URI's content in an
* individual disk file, this method will identify the file corresponding
* to this record. This may be used to implement the "stream-as-file"
* semantics required by some plugins and by the 'jar:' protocol handler.
* However, not all cache implementations are *required* to store the data
* from each URI in an individual file, so it is acceptable for an
* implementation of this method to signal NS_NOT_IMPLEMENTED.
*/
readonly attribute nsIFileSpec filename;
};

View File

@@ -1,106 +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 Communicator client code, released
* March 31, 1998.
*
* 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):
* Scott Furman, fur@netscape.com
*/
#include "nsrootidl.idl"
#include "nsISupports.idl"
interface nsIFileSpec;
interface nsIStreamAsFileObserver;
/**
* In addition to enhancing effective network response time via caching, the
* cache manager serves a second purpose by providing the stream-as-file
* service required by traditional browser plugins and the jar: protocol
* handler. The interface below provides a means for a client to determine the
* filename associated with a stream and to detect modification/deletion of
* that file.
*/
[scriptable, uuid(0eedbbf0-92d9-11d3-90d3-0040056a906e)]
interface nsIStreamAsFile : nsISupports
{
/**
* Filename containing stream-as-file
*/
readonly attribute nsIFileSpec fileSpec;
/**
* Add an observer for this cache record. When the cache wants to delete
* or truncate a record, so as to make space for another cache entry's
* content data, it will call <code>aObserver</code>'s Observe() method,
* passing the nsIStreamAsFile instance as the <code>aSubject</code>
* argument and an appropriate message. If the observer does not wish to
* inhibit deletion/truncation, it should Release() any references it has to the
* cache record.
*
* @See nsIStreamAsFileObserver
*/
void addObserver(in nsIStreamAsFileObserver aObserver);
/**
* Delete an observer that was added by the AddObserver() method.
*/
void removeObserver(in nsIStreamAsFileObserver aObserver);
};
/**
* This interface can be implemented by a client to receive notifications of
* either modification or deletion of a file created by the cache manager using
* the stream-as-file semantics.
*/
[scriptable, uuid(a26e27c0-92da-11d3-90d3-0040056a906e)]
interface nsIStreamAsFileObserver : nsISupports
{
/**
* Flag bits for argument to Observe() method.
*/
const long NOTIFY_AVAILABLE = 1 << 0; // Stream-as-file now available for reading
const long NOTIFY_ERROR = 1 << 1; // Error while loading stream / creating file
const long REQUEST_DELETION = 1 << 2; // Cache manager wishes to delete/truncate file
const long INVALIDATE = 1 << 3; // File is out-of-date
// Convenience value
const long MAKE_UNAVAILABLE = REQUEST_DELETION | INVALIDATE;
/**
* Receive either a notification or a request concerning a file that has
* been opened using stream-as-file. The aMessage and aError arguments
* have varying values depending on the nature of the notification.
* aMessage is set to NOTIFY_AVAILABLE when a complete stream has been read
* and stored on disk in a file. At that point, and no sooner, may the
* filename attribute of the associated nsIStreamAsFile be accessed via the
* associated nsIStreamAsFile interface. If the aMessage argument is
* NOTIFY_ERROR, the aError argument contains the relevant error code. If
* the aMessage argument is either REQUEST_DELETION or REQUEST_TRUNCATION,
* the callee should immediately Release() all references to the
* nsIStreamAsFile (and any references to its associated nsICachedNetData
* instances), unless it wishes to inhibit the requested file modification.
* If the aMessage argument is INVALIDATE, the cache manager is replacing
* the file with a more recent version. If a client wants to continue
* using the (now out-of-date) file, it must delete it when it has finished,
* as the cache manager will effectively relinquished ownership of the
* file.
*/
void ObserveStreamAsFile(in nsIStreamAsFile aStreamAsFile,
in PRUint32 aMessage,
in nsresult aError);
};

View File

@@ -0,0 +1,197 @@
#
# 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
DIRS = public
PROGRAM = viewer
CPPSRCS = \
$(TOOLKIT_CPPSRCS) \
nsBaseDialog.cpp \
nsFindDialog.cpp \
nsXPBaseWindow.cpp \
nsTableInspectorDialog.cpp \
nsImageInspectorDialog.cpp \
nsPrintSetupDialog.cpp \
nsBrowserWindow.cpp \
nsEditorMode.cpp \
nsSetupRegistry.cpp \
nsThrobber.cpp \
nsViewerApp.cpp \
nsWebCrawler.cpp \
$(NULL)
EXPORT_RESOURCE_SAMPLES := \
$(wildcard $(srcdir)/samples/test*.html) \
$(wildcard $(srcdir)/samples/toolbarTest*.xul) \
$(wildcard $(srcdir)/samples/treeTest*.xul) \
$(wildcard $(srcdir)/samples/treeTest*.css) \
$(wildcard $(srcdir)/samples/slider*.xul) \
$(wildcard $(srcdir)/samples/scrollbar*.xul) \
$(srcdir)/resources/find.html \
$(srcdir)/resources/printsetup.html \
$(srcdir)/resources/image_props.html \
$(srcdir)/samples/aform.css \
$(srcdir)/samples/bform.css \
$(srcdir)/samples/cform.css \
$(srcdir)/samples/demoform.css \
$(srcdir)/samples/mozform.css \
$(srcdir)/samples/xulTest.css \
$(srcdir)/samples/Anieyes.gif \
$(srcdir)/samples/gear1.gif \
$(srcdir)/samples/rock_gra.gif \
$(srcdir)/samples/beeptest.html \
$(srcdir)/samples/soundtest.html \
$(srcdir)/samples/bg.jpg \
$(srcdir)/samples/raptor.jpg \
$(srcdir)/samples/test.wav \
$(srcdir)/samples/checkboxTest.xul \
$(NULL)
EXPORT_RESOURCE_THROBBER := $(wildcard $(srcdir)/throbber/anim*.gif)
ifeq (,$(filter beos os2 rhapsody photon,$(MOZ_WIDGET_TOOLKIT)))
DIRS += unix
UNIX_VIEWER_TK_LIBS = $(DIST)/lib/libviewer_$(MOZ_WIDGET_TOOLKIT)_s.a
else
ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
BEOS_PROGRAM_RESOURCE = $(srcdir)/viewer-beos.rsrc
TOOLKIT_CPPSRCS = nsBeOSMain.cpp
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
TOOLKIT_CPPSRCS = nsPhMain.cpp nsPhMenu.cpp
endif
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
GTK_GLUE = -lgtksuperwin
endif
ifdef MOZ_OJI
JSJ_LIB = -ljsj
endif
XP_DIST_LIBS = \
-lraptorgfx \
-lmozjs \
-lxpcom \
$(JSJ_LIB) \
$(NULL)
XP_NS_UNDERBAR_CRAP = \
$(MOZ_NECKO_UTIL_LIBS) \
$(MOZ_TIMER_LIBS) \
$(MOZ_WIDGET_SUPPORT_LIBS) \
$(NULL)
XP_LIBS = \
$(XP_NS_UNDERBAR_CRAP) \
$(XP_DIST_LIBS) \
$(NSPR_LIBS) \
$(NULL)
ifdef MOZ_FULLCIRCLE
XP_LIBS += $(FULLCIRCLE_LIBS)
endif
LIBS = \
$(UNIX_VIEWER_TK_LIBS) \
$(GTK_GLUE) \
$(XP_LIBS) \
$(TK_LIBS) \
$(NULL)
MOTIF_LIBS = -lviewer_motif_s $(XP_LIBS) $(MOZ_MOTIF_LDFLAGS)
QT_LIBS = -lviewer_qt_s $(XP_LIBS) $(MOZ_QT_LDFLAGS)
XLIB_LIBS = -lviewer_xlib_s $(XP_LIBS) $(MOZ_XLIB_LDFLAGS)
GTK_LIBS = -lviewer_gtk_s -lgtksuperwin $(XP_LIBS) $(MOZ_GTK_LDFLAGS)
EXTRA_DEPS = \
$(addprefix $(DIST)/,$(patsubst -l%,bin/lib%.$(DLL_SUFFIX),$(XP_DIST_LIBS:-l%_s=lib/lib%_s.a))) \
$(UNIX_VIEWER_TK_LIBS) \
$(XP_NS_UNDERBAR_CRAP) \
$(NULL)
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
install:: $(PROGRAM) $(srcdir)/mozilla-viewer.sh
$(INSTALL) $(EXPORT_RESOURCE_SAMPLES) $(DIST)/bin/res/samples
$(INSTALL) $(EXPORT_RESOURCE_THROBBER) $(DIST)/bin/res/throbber
$(INSTALL) $(srcdir)/resources/viewer.properties $(DIST)/bin/res
$(INSTALL) $(srcdir)/mozilla-viewer.sh $(DIST)/bin
$(PROGRAM)_gtk: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in $(DIST)/lib/libviewer_gtk_s.a
$(CCC) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(GTK_LIBS) $(OS_LIBS)
$(MOZ_POST_PROGRAM_COMMAND) $@
$(PROGRAM)_motif: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in $(DIST)/lib/libviewer_motif_s.a
$(CCC) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(MOTIF_LIBS) $(OS_LIBS)
$(MOZ_POST_PROGRAM_COMMAND) $@
$(PROGRAM)_qt: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in $(DIST)/lib/libviewer_qt_s.a
$(CCC) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(QT_LIBS) $(OS_LIBS)
$(MOZ_POST_PROGRAM_COMMAND) $@
$(PROGRAM)_xlib: $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in $(DIST)/lib/libviewer_xlib_s.a
$(CCC) -o $@ $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(XLIB_LIBS) $(OS_LIBS)
$(MOZ_POST_PROGRAM_COMMAND) $@
ifdef MOZ_ENABLE_GTK
install:: $(PROGRAM)_gtk
$(INSTALL) -m 555 $< $(DIST)/bin
clobber::
rm -f $(PROGRAM)_gtk
endif
ifdef MOZ_ENABLE_MOTIF
install:: $(PROGRAM)_motif
$(INSTALL) -m 555 $< $(DIST)/bin
clobber::
rm -f $(PROGRAM)_motif
endif
ifdef MOZ_ENABLE_QT
install:: $(PROGRAM)_qt
$(INSTALL) -m 555 $< $(DIST)/bin
clobber::
rm -f $(PROGRAM)_qt
endif
ifdef MOZ_ENABLE_XLIB
install:: $(PROGRAM)_xlib
$(INSTALL) -m 555 $< $(DIST)/bin
clobber::
rm -f $(PROGRAM)_xlib
endif

View File

@@ -0,0 +1,179 @@
/* -*- 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 <gtk/gtk.h>
#include "gdksuperwin.h"
#include "gtkmozbox.h"
#include "nsBrowserWindow.h"
#include "resources.h"
#include "nscore.h"
#include "stdio.h"
typedef GtkItemFactoryCallback GIFC;
void gtk_ifactory_cb (nsBrowserWindow *nbw,
guint callback_action,
GtkWidget *widget)
{
nbw->DispatchMenuItem(callback_action);
}
GtkItemFactoryEntry menu_items[] =
{
{ "/_File", nsnull, nsnull, 0, "<Branch>" },
{ "/File/_New Window", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_WINDOW_OPEN, nsnull },
{ "/File/_Open...", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_FILE_OPEN, nsnull },
{ "/File/_View Source", nsnull, (GIFC)gtk_ifactory_cb, VIEW_SOURCE, nsnull },
{ "/File/_Samples", nsnull, nsnull, 0, "<Branch>" },
{ "/File/Samples/demo #0", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO0, nsnull },
{ "/File/Samples/demo #1", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO1, nsnull },
{ "/File/Samples/demo #2", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO2, nsnull },
{ "/File/Samples/demo #3", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO3, nsnull },
{ "/File/Samples/demo #4", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO4, nsnull },
{ "/File/Samples/demo #5", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO5, nsnull },
{ "/File/Samples/demo #6", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO6, nsnull },
{ "/File/Samples/demo #7", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO7, nsnull },
{ "/File/Samples/demo #8", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO8, nsnull },
{ "/File/Samples/demo #9", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO9, nsnull },
{ "/File/Samples/demo #10", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO10, nsnull },
{ "/File/Samples/demo #11", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO11, nsnull },
{ "/File/Samples/demo #12", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO12, nsnull },
{ "/File/Samples/demo #13", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO13, nsnull },
{ "/File/Samples/demo #14", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO14, nsnull },
{ "/File/Samples/demo #15", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO15, nsnull },
{ "/File/Samples/demo #16", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO16, nsnull },
{ "/File/Samples/demo #17", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEMO17, nsnull },
{ "/File/_Test Sites", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOP100, nsnull },
{ "/File/XPToolkit Tests", nsnull, nsnull, 0, "<Branch>" },
{ "/File/XPToolkit Tests/Toolbar Test 1", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_XPTOOLKITTOOLBAR1, nsnull },
{ "/File/XPToolkit Tests/Tree Test 1", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_XPTOOLKITTREE1, nsnull },
{ "/File/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/File/Print Preview", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_ONE_COLUMN, nsnull },
{ "/File/Print", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_PRINT, nsnull },
{ "/File/Print Setup", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_PRINT_SETUP, nsnull },
{ "/File/sep2", nsnull, nsnull, 0, "<Separator>" },
{ "/File/_Exit", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EXIT, nsnull },
{ "/_Edit", nsnull, nsnull, 0, "<Branch>" },
{ "/Edit/Cu_t", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EDIT_CUT, nsnull },
{ "/Edit/_Copy", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EDIT_COPY, nsnull },
{ "/Edit/_Paste", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EDIT_PASTE, nsnull },
{ "/Edit/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Edit/Select All", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EDIT_SELECTALL, nsnull },
{ "/Edit/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Edit/Find in Page", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_EDIT_FINDINPAGE, nsnull },
//#ifdef DEBUG // turning off for now
{ "/_Debug", nsnull, nsnull, 0, "<Branch>" },
{ "/Debug/_Visual Debugging", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_VISUAL_DEBUGGING,nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Event Debugging/Toggle Paint Flashing", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_PAINT_FLASHING,nsnull },
{ "/Debug/Event Debugging/Toggle Paint Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_PAINT_DUMPING,nsnull },
{ "/Debug/Event Debugging/Toggle Invalidate Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_INVALIDATE_DUMPING,nsnull },
{ "/Debug/Event Debugging/Toggle Event Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_EVENT_DUMPING,nsnull },
{ "/Debug/Event Debugging/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Event Debugging/Toggle Motion Event Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_MOTION_EVENT_DUMPING,nsnull },
{ "/Debug/Event Debugging/Toggle Crossing Event Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_CROSSING_EVENT_DUMPING,nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/_Reflow Test", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_REFLOW_TEST, nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Dump _Content", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_CONTENT, nsnull },
{ "/Debug/Dump _Frames", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_FRAMES, nsnull },
{ "/Debug/Dump _Views", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_VIEWS, nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Dump _Style Sheets", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_SHEETS, nsnull },
{ "/Debug/Dump _Style Contexts", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_CONTEXTS, nsnull},
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Show Content Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_CONTENT_SIZE,nsnull },
{ "/Debug/Show Frame Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_FRAME_SIZE, nsnull },
{ "/Debug/Show Style Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_STYLE_SIZE, nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Debug Save", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEBUGSAVE, nsnull },
{ "/Debug/Debug Output Text", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYTEXT, nsnull },
{ "/Debug/Debug Output HTML", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYHTML, nsnull },
{ "/Debug/Debug Toggle Selection", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_SELECTION,nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Debug Robot", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEBUGROBOT, nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Show Content Quality", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_CONTENT_QUALITY, nsnull },
{ "/_Style", nsnull, nsnull, 0, "<Branch>" },
{ "/Style/Select _Style Sheet", nsnull, nsnull, 0, "<Branch>" },
{ "/Style/Select Style Sheet/List Available Sheets", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_LIST, nsnull },
{ "/Style/Select Style Sheet/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Style/Select Style Sheet/Select Default", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_DEFAULT, nsnull },
{ "/Style/Select Style Sheet/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Style/Select Style Sheet/Select Alternative 1", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_ONE, nsnull },
{ "/Style/Select Style Sheet/Select Alternative 2", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_TWO, nsnull },
{ "/Style/Select Style Sheet/Select Alternative 3", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_THREE, nsnull },
{ "/Style/Select Style Sheet/Select Alternative 4", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SELECT_STYLE_FOUR, nsnull },
{ "/Style/_Compatibility Mode", nsnull, nsnull, 0, "<Branch>" },
{ "/Style/Compatibility Mode/Nav Quirks", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_NAV_QUIRKS_MODE, nsnull },
{ "/Style/Compatibility Mode/Standard", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_STANDARD_MODE, nsnull },
{ "/Style/_Widget Render Mode", nsnull, nsnull, 0, "<Branch>" },
{ "/Style/Widget Render Mode/Native", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_NATIVE_WIDGET_MODE, nsnull },
{ "/Style/Widget Render Mode/Gfx", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_GFX_WIDGET_MODE, nsnull },
//#endif
{ "/_Tools", nsnull, nsnull, 0, "<Branch>" },
{ "/Tools/_JavaScript Console", nsnull, (GIFC)gtk_ifactory_cb, JS_CONSOLE, nsnull },
{ "/Tools/_Editor Mode", nsnull, (GIFC)gtk_ifactory_cb, EDITOR_MODE, nsnull }
};
void CreateViewerMenus(nsIWidget * aParent,
gpointer data,
GtkWidget ** aMenuBarOut)
{
NS_ASSERTION(nsnull != aParent,"null parent.");
NS_ASSERTION(nsnull != aMenuBarOut,"null out param.");
GtkItemFactory *item_factory;
GtkWidget *menubar;
GdkSuperWin *gdkSuperWin;
GtkWidget *mozBox;
gdkSuperWin = (GdkSuperWin*)aParent->GetNativeData(NS_NATIVE_WIDGET);
int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", nsnull);
gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, data);
menubar = gtk_item_factory_get_widget (item_factory, "<main>");
gtk_menu_bar_set_shadow_type (GTK_MENU_BAR(menubar), GTK_SHADOW_NONE);
NS_ASSERTION(GDK_IS_SUPERWIN(gdkSuperWin), "code assumes a gdksuperwin.");
mozBox = gtk_mozbox_new(gdkSuperWin->bin_window);
NS_ASSERTION((mozBox != NULL), "failed to create mozBox.");
gtk_container_add(GTK_CONTAINER(mozBox), menubar);
gtk_mozbox_set_position(GTK_MOZBOX(mozBox), 0, 0 );
gtk_widget_show(mozBox);
gtk_widget_show(menubar);
*aMenuBarOut = menubar;
}

View File

@@ -26,13 +26,42 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = \
public \
memcache \
filecache \
mgr \
build \
$(NULL)
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 += gtksuperwin
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

@@ -0,0 +1,100 @@
#
# 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_gtk
REQUIRES = util img xpcom raptor netlib
CPPSRCS = \
nsAppShell.cpp \
nsButton.cpp \
nsCheckButton.cpp \
nsClipboard.cpp \
nsComboBox.cpp \
nsContextMenu.cpp \
nsDragService.cpp \
nsFilePicker.cpp \
nsFileWidget.cpp \
nsFontRetrieverService.cpp \
nsFontSizeIterator.cpp \
nsGtkEventHandler.cpp \
nsGtkUtils.cpp \
nsLabel.cpp \
nsListBox.cpp \
nsLookAndFeel.cpp \
nsMenu.cpp \
nsMenuBar.cpp \
nsMenuItem.cpp \
nsPopUpMenu.cpp \
nsRadioButton.cpp \
nsScrollbar.cpp \
nsSound.cpp \
nsTextAreaWidget.cpp \
nsTextHelper.cpp \
nsTextWidget.cpp \
nsToolkit.cpp \
nsWidget.cpp \
nsWidgetFactory.cpp \
nsWindow.cpp \
$(NULL)
SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.a
EXTRA_DSO_LDOPTS = \
$(MKSHLIB_FORCE_ALL) \
$(SHARED_LIBRARY_LIBS) \
$(MKSHLIB_UNFORCE_ALL) \
$(MOZ_COMPONENT_LIBS) \
-lraptorgfx \
$(NULL)
ifndef MOZ_MONOLITHIC_TOOLKIT
EXTRA_DSO_LDOPTS += -L$(DIST)/lib -lgtksuperwin $(MOZ_GTK_LDFLAGS)
else
EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif
include $(topsrcdir)/config/rules.mk
ifndef MOZ_MONOLITHIC_TOOLKIT
CXXFLAGS += $(MOZ_GTK_CFLAGS)
CFLAGS += $(MOZ_GTK_CFLAGS)
else
CXXFLAGS += $(TK_CFLAGS)
CFLAGS += $(TK_CFLAGS)
endif
DEFINES += -D_IMPL_NS_WIDGET -DUSE_XIM
ifeq ($(OS_ARCH), Linux)
DEFINES += -D_BSD_SOURCE
endif
INCLUDES += \
-I$(srcdir)/../xpwidgets \
-I$(srcdir) \
$(NULL)
$(LIBRARY) $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) Makefile

View File

@@ -0,0 +1,292 @@
/* XPM */
static char * mozilla_icon_xpm[] = {
"32 32 257 2",
" c None",
". c #AA7303",
"+ c #A67003",
"@ c #B77C03",
"# c #8D6003",
"$ c #8D6004",
"% c #6C4A04",
"& c #3A2804",
"* c #6B4802",
"= c #9B6903",
"- c #5A2C04",
"; c #411B04",
"> c #9D6A03",
", c #7A5203",
"' c #510D04",
") c #6B1104",
"! c #7D5503",
"~ c #674604",
"{ c #C21E04",
"] c #C21D04",
"^ c #523804",
"/ c #513702",
"( c #552904",
"_ c #DD2204",
": c #DF2204",
"< c #582904",
"[ c #5F3F02",
"} c #6B2504",
"| c #FE2604",
"1 c #AB7303",
"2 c #9B6904",
"3 c #C31F04",
"4 c #FE2704",
"5 c #A81904",
"6 c #926304",
"7 c #4D3302",
"8 c #483104",
"9 c #C61E04",
"0 c #B11B04",
"a c #891604",
"b c #761204",
"c c #614304",
"d c #775102",
"e c #795102",
"f c #785102",
"g c #C58603",
"h c #642404",
"i c #B21A04",
"j c #1F0604",
"k c #550E04",
"l c #631004",
"m c #402404",
"n c #AF7703",
"o c #3D2902",
"p c #7F5602",
"q c #805604",
"r c #0C0904",
"s c #080604",
"t c #080706",
"u c #090604",
"v c #060404",
"w c #620F04",
"x c #7A1304",
"y c #030204",
"z c #570E04",
"A c #721204",
"B c #270704",
"C c #080504",
"D c #0A0604",
"E c #533804",
"F c #A56F02",
"G c #B87C03",
"H c #3B2804",
"I c #A51904",
"J c #FC2704",
"K c #D62004",
"L c #691004",
"M c #C01E04",
"N c #6D1004",
"O c #9C1804",
"P c #B31C04",
"Q c #150404",
"R c #801404",
"S c #DD2304",
"T c #120404",
"U c #130404",
"V c #500C04",
"W c #CC1E04",
"X c #AA1A04",
"Y c #100904",
"Z c #B47A03",
"` c #A77103",
" . c #513704",
".. c #891704",
"+. c #F62604",
"@. c #BA1D04",
"#. c #3C0A04",
"$. c #EB2304",
"%. c #DE2304",
"&. c #560E04",
"*. c #E82304",
"=. c #FE2804",
"-. c #BE1D04",
";. c #F12404",
">. c #661004",
",. c #020204",
"'. c #5E0F04",
"). c #A61A04",
"!. c #4A3204",
"~. c #BC7E03",
"{. c #8E6002",
"]. c #684604",
"^. c #390D04",
"/. c #EE2404",
"(. c #FE2904",
"_. c #7D1304",
":. c #8C1504",
"<. c #200604",
"[. c #A81A04",
"}. c #E72204",
"|. c #DA2004",
"1. c #070204",
"2. c #280704",
"3. c #543904",
"4. c #9F6C02",
"5. c #674602",
"6. c #B47B04",
"7. c #311004",
"8. c #B11C04",
"9. c #AA1B04",
"0. c #6A1104",
"a. c #801504",
"b. c #2B0704",
"c. c #09090A",
"d. c #450B04",
"e. c #360904",
"f. c #DC2204",
"g. c #EE2504",
"h. c #C11D04",
"i. c #6F1104",
"j. c #704B04",
"k. c #9C6902",
"l. c #A56F03",
"m. c #5F4004",
"n. c #8D1604",
"o. c #440A04",
"p. c #1A0504",
"q. c #931604",
"r. c #621004",
"s. c #7F1404",
"t. c #921704",
"u. c #F82504",
"v. c #F52504",
"w. c #981804",
"x. c #241804",
"y. c #5B3E04",
"z. c #D82204",
"A. c #D02004",
"B. c #DA2104",
"C. c #D52104",
"D. c #2A1A04",
"E. c #AC7403",
"F. c #2B1C04",
"G. c #D04004",
"H. c #FC3C04",
"I. c #F94E04",
"J. c #881504",
"K. c #FC2604",
"L. c #792804",
"M. c #AC7503",
"N. c #9A6803",
"O. c #782804",
"P. c #F66504",
"Q. c #F94B04",
"R. c #F46804",
"S. c #F46604",
"T. c #F76504",
"U. c #FB4204",
"V. c #C13D04",
"W. c #5D0E04",
"X. c #DA2204",
"Y. c #741604",
"Z. c #8C5E03",
"`. c #885B03",
" + c #8B1904",
".+ c #DE2204",
"++ c #D22D04",
"@+ c #C42D04",
"#+ c #580E04",
"$+ c #9F1804",
"%+ c #895D04",
"&+ c #D62204",
"*+ c #371904",
"=+ c #2C1A04",
"-+ c #4A0C04",
";+ c #140404",
">+ c #AB1A04",
",+ c #DA2304",
"'+ c #6A4702",
")+ c #754F02",
"!+ c #821404",
"~+ c #462B04",
"{+ c #B37A03",
"]+ c #B17803",
"^+ c #714C04",
"/+ c #580F04",
"(+ c #E32204",
"_+ c #DD2104",
":+ c #611D04",
"<+ c #BA7F03",
"[+ c #B27803",
"}+ c #6F1D04",
"|+ c #FD2704",
"1+ c #F22504",
"2+ c #634304",
"3+ c #875B03",
"4+ c #734F02",
"5+ c #805704",
"6+ c #1D0504",
"7+ c #DB2204",
"8+ c #EA2404",
"9+ c #2E0804",
"0+ c #815803",
"a+ c #941704",
"b+ c #C11E04",
"c+ c #391B04",
"d+ c #A77104",
"e+ c #B67C04",
"f+ c #371D04",
"g+ c #360A04",
"h+ c #573A04",
"i+ c #372604",
"j+ c #3E2104",
"k+ c #B57A03",
"l+ c #B57B03",
"m+ c #603F04",
"n+ c #430A04",
"o+ c #351904",
"p+ c #A36E03",
"q+ c #BE8103",
"r+ c #1D1404",
"s+ c #483004",
"t+ c #A26E03",
"u+ c #6D4B02",
"v+ c #825804",
"w+ c #0B0804",
"x+ c #976603",
"y+ c #815703",
"z+ c #926404",
"A+ c #895D03",
"B+ c #614202",
"C+ c #9A6804",
"D+ c #C88704",
"E+ c #C18303",
"F+ c #654302",
"G+ c #744F02",
"H+ c #704B02",
" ",
" . ",
" + @ ",
" # $ ",
" % & * ",
" = - ; > ",
" , ' ) ! ",
" ~ { ] ^ ",
" / ( _ : < [ ",
" . } | | } 1 ",
" 2 3 | 4 5 6 ",
" 7 8 9 0 a b c ",
" d e f f f d d d d d d g h i j k l m n d d d d d d d d d d d o ",
" p q r s s s s t s s u v w x y z A B C D D D D D s s s s E F ",
" G H I J 4 | 4 | K L L M N O P Q R | S T U V W X Y Z ",
" ` ...+.| 4 @.#.$.4 | %.&.*.4 =.-.;.>.,.'.).!.~. ",
" {.].^./.(.X _.;.| :.T <.[.| }.z | |.1.2.3.4. ",
" 5.6.7.8.9.0.a.b.c.d.e.f.g.h.&.| i.u j.k. ",
" l.m.n.o.p.q._.r.a.s.t.u.v.w.x.Z ",
" {.y.P z.R A.v.x j B.| C.D.E. ",
" F.G.H.I.4 | 4 t.J.f.K.L.M. ",
" N.O.P.Q.R.S.T.U.V.W.X.4 Y.Z. ",
" `. +4 =.| | .+++@+#+$+| K %+ ",
" %+&+| | | I *+=+-+;+>+,+&+x.'+ ",
" )+=+X.=.| !+~+{+]+^+,./+(+_+:+<+ ",
" [+}+|+1+) 2+3+ 4+5+6+7+8+9+0+ ",
" $ a+b+c+d+ e+f+0.g+h+ ",
" i+A j+k+ l+m+n+o+p+ ",
" q+r+s+t+ u+v+w+x+ ",
" y+z+A+ B+C+2 ",
" D+ E+F+ ",
" G+ H+ "};

View File

@@ -0,0 +1,63 @@
/* XPM */
static char * mozicon50_xpm[] = {
"50 51 9 1",
" c None",
". c #000000",
"+ c #FF0000",
"@ c #808000",
"# c #800000",
"$ c #FF6633",
"% c #990066",
"& c #FF00FF",
"* c #222222",
" ",
" @ ",
" $@ ",
" @@ ",
" @@$ ",
" $@*@ ",
" @@.@ ",
" @..@ ",
" $@..@@ ",
" $@##*@ ",
" @*#+.@ ",
" @.++.@$ ",
" $@.++.@$ ",
" @*#++#*@ ",
" @.++++.@ ",
" $@.++++.@$ ",
" @*#++++**@ ",
" @.#++++#.@ ",
" $@.++####.@ ",
" @@*+#*##*.@@ ",
"*@@@@@@@@@@@@@@@@@@@.#+..*##*#@@@@@@@@@@@@@@@@@@@*",
" *@@*................+#..*###.................@@* ",
" %@@@.#++++++++++++#**#*#++.###++*...#+++#.*@@* ",
" *@@.#+++++++++#.##++#+#+*.#+++#..##++#.@@@% ",
" $@..+++++++.#++++++##++++#++#...++*.@@$ ",
" @@*.#+++++.#+++++*.#++++##++#.*...@@ ",
" $@@.#+++#*++++#....#+++*#+++...*@$ ",
" *@@..++#*++#**.*.*+++#.#++*..@@$ ",
" $@*.++******#+++++#+#+++..@@ ",
" $@@.##..*$#**#+#*#++++..@@ ",
" $@@.#+#***##...#++++.*@@ ",
" %@@*++++++++#.#++++.@@ ",
" @.#+++++++++.##+++.@$ ",
" @.+$$$$$+$$$#*#+++*@@ ",
" $@*+$$$$$$$+$#.#+++#.@ ",
" @*#+++++++++++.#++++.@ ",
" @.#+++++++#*++.##+++.@$ ",
" $@.+++++++....#..+#++*@@ ",
" @@*+++++#.*@@@...*+++#.@ ",
" @.#++++#.@@@ @@..#++++.@ ",
" @.++++*.@@$ %@@..+++#.@@ ",
" $@.+++..@@* $@*.#+#**@ ",
" @@#+#.*@$% $@@.##..@ ",
" @.##.@@ @@..#.@$ ",
" $@.*.@@$ @@**.@$ ",
" $@.*@@ %$@@.*@ ",
" @.@@$ *@@.@ ",
" @@@$ %@@@$ ",
" $@@% %@@@ ",
" @@ $@ ",
" $ * "};

View File

@@ -0,0 +1,459 @@
/* -*- 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):
*/
#include "prmon.h"
#include "nsCOMPtr.h"
#include "nsAppShell.h"
#include "nsIAppShell.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsICmdLineService.h"
#include "nsGtkEventHandler.h"
#include <stdlib.h>
#ifdef MOZ_GLE
#include <gle/gle.h>
#endif
#include "nsIWidget.h"
#include "nsIPref.h"
#include "glib.h"
struct OurGdkIOClosure {
GdkInputFunction function;
gpointer data;
};
static gboolean
our_gdk_io_invoke(GIOChannel* source, GIOCondition condition, gpointer data)
{
OurGdkIOClosure* ioc = (OurGdkIOClosure*) data;
if (ioc) {
(*ioc->function)(ioc->data, g_io_channel_unix_get_fd(source),
GDK_INPUT_READ);
}
return TRUE;
}
static void
our_gdk_io_destroy(gpointer data)
{
OurGdkIOClosure* ioc = (OurGdkIOClosure*) data;
if (ioc) {
g_free(ioc);
}
}
static gint
our_gdk_input_add (gint source,
GdkInputFunction function,
gpointer data,
gint priority)
{
guint result;
OurGdkIOClosure *closure = g_new (OurGdkIOClosure, 1);
GIOChannel *channel;
closure->function = function;
closure->data = data;
channel = g_io_channel_unix_new (source);
result = g_io_add_watch_full (channel, priority, G_IO_IN,
our_gdk_io_invoke,
closure, our_gdk_io_destroy);
g_io_channel_unref (channel);
return result;
}
//-------------------------------------------------------------------------
//
// XPCOM CIDs
//
//-------------------------------------------------------------------------
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kCmdLineServiceCID, NS_COMMANDLINE_SERVICE_CID);
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
// a linked, ordered list of event queues and their tokens
class EventQueueToken {
public:
EventQueueToken(nsIEventQueue *aQueue, const gint aToken);
virtual ~EventQueueToken();
nsIEventQueue *mQueue;
gint mToken;
EventQueueToken *mNext;
};
EventQueueToken::EventQueueToken(nsIEventQueue *aQueue, const gint aToken) {
mQueue = aQueue;
NS_IF_ADDREF(mQueue);
mToken = aToken;
mNext = 0;
}
EventQueueToken::~EventQueueToken(){
NS_IF_RELEASE(mQueue);
}
class EventQueueTokenQueue {
public:
EventQueueTokenQueue();
virtual ~EventQueueTokenQueue();
nsresult PushToken(nsIEventQueue *aQueue, gint aToken);
PRBool PopToken(nsIEventQueue *aQueue, gint *aToken);
private:
EventQueueToken *mHead;
};
EventQueueTokenQueue::EventQueueTokenQueue() {
mHead = 0;
}
EventQueueTokenQueue::~EventQueueTokenQueue() {
// if we reach this point with an empty token queue, well, fab. however,
// we expect the first event queue to still be active. so we take
// special care to unhook that queue (not that failing to do so seems
// to hurt anything). more queues than that would be an error.
//NS_ASSERTION(!mHead || !mHead->mNext, "event queue token list deleted when not empty");
// (and skip the assertion for now. we're leaking event queues because they
// are referenced by things that leak, so this assertion goes off a lot.)
if (mHead) {
gdk_input_remove(mHead->mToken);
delete mHead;
// and leak the rest. it's an error, anyway
}
}
nsresult EventQueueTokenQueue::PushToken(nsIEventQueue *aQueue, gint aToken) {
EventQueueToken *newToken = new EventQueueToken(aQueue, aToken);
NS_ASSERTION(newToken, "couldn't allocate token queue element");
if (!newToken)
return NS_ERROR_OUT_OF_MEMORY;
newToken->mNext = mHead;
mHead = newToken;
return NS_OK;
}
PRBool EventQueueTokenQueue::PopToken(nsIEventQueue *aQueue, gint *aToken) {
EventQueueToken *token, *lastToken;
PRBool found = PR_FALSE;
NS_ASSERTION(mHead, "attempt to retrieve event queue token from empty queue");
if (mHead)
NS_ASSERTION(mHead->mQueue == aQueue, "retrieving event queue from past head of queue queue");
token = mHead;
lastToken = 0;
while (token && token->mQueue != aQueue) {
lastToken = token;
token = token->mNext;
}
if (token) {
if (lastToken)
lastToken->mNext = token->mNext;
else
mHead = token->mNext;
found = PR_TRUE;
*aToken = token->mToken;
delete token;
}
return found;
}
//-------------------------------------------------------------------------
//
// nsAppShell constructor
//
//-------------------------------------------------------------------------
nsAppShell::nsAppShell()
{
NS_INIT_REFCNT();
mDispatchListener = 0;
mEventQueueTokens = new EventQueueTokenQueue();
// throw on error would really be civilized here
NS_ASSERTION(mEventQueueTokens, "couldn't allocate event queue token queue");
}
//-------------------------------------------------------------------------
//
// nsAppShell destructor
//
//-------------------------------------------------------------------------
nsAppShell::~nsAppShell()
{
delete mEventQueueTokens;
}
//-------------------------------------------------------------------------
//
// nsISupports implementation macro
//
//-------------------------------------------------------------------------
NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
static void event_processor_callback(gpointer data,
gint source,
GdkInputCondition condition)
{
nsIEventQueue *eventQueue = (nsIEventQueue*)data;
if (eventQueue)
eventQueue->ProcessPendingEvents();
}
#define PREF_NCOLS "browser.ncols"
#define PREF_INSTALLCMAP "browser.installcmap"
static void
HandleColormapPrefs( void )
{
PRInt32 ivalue = 0;
PRBool bvalue;
nsresult rv;
/* The default is to do nothing. INSTALLCMAP has precedence over
NCOLS. Ignore the fact we can't do this if it fails, as it is
not critical */
NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv);
if (NS_FAILED(rv) || (!prefs))
return;
/* first check ncols */
rv = prefs->GetIntPref(PREF_NCOLS, &ivalue);
if (NS_SUCCEEDED(rv) && ivalue >= 0 && ivalue <= 255 ) {
gdk_rgb_set_min_colors( ivalue );
return;
}
/* next check installcmap */
rv = prefs->GetBoolPref(PREF_INSTALLCMAP, &bvalue);
if (NS_SUCCEEDED(rv)) {
if ( PR_TRUE == bvalue )
gdk_rgb_set_min_colors( 255 ); // force it
else
gdk_rgb_set_min_colors( 0 );
}
}
//-------------------------------------------------------------------------
//
// Create the application shell
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav)
{
gchar *home=nsnull;
gchar *path=nsnull;
int argc = bac ? *bac : 0;
char **argv = bav;
#if 1
nsresult rv;
NS_WITH_SERVICE(nsICmdLineService, cmdLineArgs, kCmdLineServiceCID, &rv);
if (NS_SUCCEEDED(rv))
{
rv = cmdLineArgs->GetArgc(&argc);
if(NS_FAILED(rv))
argc = bac ? *bac : 0;
rv = cmdLineArgs->GetArgv(&argv);
if(NS_FAILED(rv))
argv = bav;
}
#endif
gtk_set_locale ();
gtk_init (&argc, &argv);
// It is most convenient for us to intercept our events after
// they have been converted to GDK, but before GTK+ gets them
gdk_event_handler_set (handle_gdk_event, NULL, NULL);
#ifdef MOZ_GLE
gle_init (&argc, &argv);
#endif
// delete the cmdLineArgs thing?
HandleColormapPrefs();
gdk_rgb_init();
home = g_get_home_dir();
if ((char*)nsnull != home) {
path = g_strdup_printf("%s%c%s", home, G_DIR_SEPARATOR, ".gtkrc");
if ((char *)nsnull != path) {
gtk_rc_parse(path);
g_free(path);
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Spinup - do any preparation necessary for running a message loop
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::Spinup()
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Spindown - do any cleanup necessary for finishing a message loop
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::Spindown()
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Run
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::Run()
{
NS_ADDREF_THIS();
nsresult rv = NS_OK;
nsIEventQueue * EQueue = nsnull;
// Get the event queue service
NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv);
if (NS_FAILED(rv)) {
NS_ASSERTION("Could not obtain event queue service", PR_FALSE);
return rv;
}
#ifdef DEBUG
printf("Got the event queue from the service\n");
#endif /* DEBUG */
//Get the event queue for the thread.
rv = eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &EQueue);
// If a queue already present use it.
if (EQueue)
goto done;
// Create the event queue for the thread
rv = eventQService->CreateThreadEventQueue();
if (NS_OK != rv) {
NS_ASSERTION("Could not create the thread event queue", PR_FALSE);
return rv;
}
//Get the event queue for the thread
rv = eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &EQueue);
if (NS_OK != rv) {
NS_ASSERTION("Could not obtain the thread event queue", PR_FALSE);
return rv;
}
done:
#ifdef DEBUG
printf("Calling gdk_input_add with event queue\n");
#endif /* DEBUG */
// (has to be called explicitly for this, the primordial appshell, because
// of startup ordering problems.)
ListenToEventQueue(EQueue, PR_TRUE);
gtk_main();
NS_IF_RELEASE(EQueue);
Release();
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Exit a message handler loop
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::Exit()
{
gtk_main_quit ();
return NS_OK;
}
// does nothing. used by xp code with non-gtk expectations.
// this method will be removed once xp eventloops are working.
NS_IMETHODIMP nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *& aEvent)
{
aRealEvent = PR_FALSE;
aEvent = 0;
return NS_OK;
}
// simply executes one iteration of the event loop. used by xp code with
// non-gtk expectations.
// this method will be removed once xp eventloops are working.
NS_IMETHODIMP nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
{
g_main_iteration(PR_TRUE);
return NS_OK;
}
NS_IMETHODIMP nsAppShell::ListenToEventQueue(nsIEventQueue *aQueue,
PRBool aListen)
{
// tell gdk to listen to the event queue or not
gint queueToken;
if (aListen) {
queueToken = our_gdk_input_add(aQueue->GetEventQueueSelectFD(),
event_processor_callback,
aQueue, G_PRIORITY_DEFAULT_IDLE);
mEventQueueTokens->PushToken(aQueue, queueToken);
} else {
if (mEventQueueTokens->PopToken(aQueue, &queueToken))
gdk_input_remove(queueToken);
}
return NS_OK;
}

View File

@@ -0,0 +1,50 @@
/* -*- 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):
*/
#ifndef nsAppShell_h__
#define nsAppShell_h__
#include "nsIAppShell.h"
#include <gtk/gtk.h>
/**
* Native GTK+ Application shell wrapper
*/
class EventQueueTokenQueue;
class nsAppShell : public nsIAppShell
{
public:
nsAppShell();
virtual ~nsAppShell();
NS_DECL_ISUPPORTS
NS_DECL_NSIAPPSHELL
private:
nsDispatchListener *mDispatchListener;
EventQueueTokenQueue *mEventQueueTokens;
};
#endif // nsAppShell_h__

View File

@@ -0,0 +1,156 @@
/* -*- 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 <gtk/gtk.h>
#include "nsGtkEventHandler.h"
#include "nsButton.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsButton, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsButton, nsWidget)
NS_IMPL_QUERY_INTERFACE2(nsButton, nsIButton, nsIWidget)
//-------------------------------------------------------------------------
//
// nsButton constructor
//
//-------------------------------------------------------------------------
nsButton::nsButton() : nsWidget() , nsIButton()
{
}
//-------------------------------------------------------------------------
//
// Create the native Button widget
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsButton::CreateNative(GtkObject *parentWindow)
{
#ifdef USE_SUPERWIN
if (!GDK_IS_SUPERWIN(parentWindow)) {
g_print("Damn, brother. That's not a superwin.\n");
return NS_ERROR_FAILURE;
}
GdkSuperWin *superwin = GDK_SUPERWIN(parentWindow);
mMozBox = gtk_mozbox_new(superwin->bin_window);
#endif
mWidget = gtk_button_new_with_label("");
gtk_widget_set_name(mWidget, "nsButton");
#ifdef USE_SUPERWIN
// make sure that we put the scrollbar into the mozbox
gtk_container_add(GTK_CONTAINER(mMozBox), mWidget);
#endif /* USE_SUPERWIN */
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsButton destructor
//
//-------------------------------------------------------------------------
nsButton::~nsButton()
{
}
void nsButton::InitCallbacks(char * aName)
{
InstallButtonPressSignal(mWidget);
InstallButtonReleaseSignal(mWidget);
InstallEnterNotifySignal(mWidget);
InstallLeaveNotifySignal(mWidget);
// These are needed so that the events will go to us and not our parent.
AddToEventMask(mWidget,
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsButton::SetLabel(const nsString& aText)
{
NS_ALLOC_STR_BUF(label, aText, 256);
gtk_label_set(GTK_LABEL(GTK_BIN (mWidget)->child), label);
NS_FREE_STR_BUF(label);
return (NS_OK);
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsButton::GetLabel(nsString& aBuffer)
{
char * text;
gtk_label_get(GTK_LABEL(GTK_BIN (mWidget)->child), &text);
aBuffer.SetLength(0);
aBuffer.Append(text);
return (NS_OK);
}
//-------------------------------------------------------------------------
//
// set font for button
//
//-------------------------------------------------------------------------
/* virtual */
void nsButton::SetFontNative(GdkFont *aFont)
{
GtkStyle *style = gtk_style_copy(GTK_BIN (mWidget)->child->style);
// gtk_style_copy ups the ref count of the font
gdk_font_unref (style->font);
style->font = aFont;
gdk_font_ref(style->font);
gtk_widget_set_style(GTK_BIN (mWidget)->child, style);
gtk_style_unref(style);
}

View File

@@ -0,0 +1,53 @@
/* -*- 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 nsButton_h__
#define nsButton_h__
#include "nsWidget.h"
#include "nsIButton.h"
/**
* Native GTK+ button wrapper
*/
class nsButton : public nsWidget,
public nsIButton
{
public:
nsButton();
virtual ~nsButton();
NS_DECL_ISUPPORTS_INHERITED
// nsIButton part
NS_IMETHOD SetLabel(const nsString& aText);
NS_IMETHOD GetLabel(nsString& aBuffer);
virtual void SetFontNative(GdkFont *aFont);
protected:
NS_METHOD CreateNative(GtkObject *parentWindow);
virtual void InitCallbacks(char * aName = nsnull);
};
#endif // nsButton_h__

View File

@@ -0,0 +1,250 @@
/* -*- 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 "nsCheckButton.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsCheckButton, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsCheckButton, nsWidget)
NS_IMPL_QUERY_INTERFACE2(nsCheckButton, nsICheckButton, nsIWidget)
//-------------------------------------------------------------------------
//
// nsCheckButton constructor
//
//-------------------------------------------------------------------------
nsCheckButton::nsCheckButton() : nsWidget() , nsICheckButton()
{
NS_INIT_REFCNT();
mLabel = nsnull;
mCheckButton = nsnull;
mState = PR_FALSE;
}
//-------------------------------------------------------------------------
//
// nsCheckButton destructor
//
//-------------------------------------------------------------------------
nsCheckButton::~nsCheckButton()
{
}
void
nsCheckButton::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mCheckButton) {
mCheckButton = nsnull;
}
else if (aGtkWidget == mLabel) {
mLabel = nsnull;
}
else {
nsWidget::OnDestroySignal(aGtkWidget);
}
}
//-------------------------------------------------------------------------
//
// Create the native CheckButton widget
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::CreateNative(GtkObject *parentWindow)
{
mWidget = gtk_event_box_new();
mCheckButton = gtk_check_button_new();
gtk_container_add(GTK_CONTAINER(mWidget), mCheckButton);
gtk_widget_show(mCheckButton);
gtk_widget_set_name(mWidget, "nsCheckButton");
return NS_OK;
}
void nsCheckButton::InitCallbacks(char * aName)
{
InstallButtonPressSignal(mCheckButton);
InstallButtonReleaseSignal(mCheckButton);
InstallEnterNotifySignal(mWidget);
InstallLeaveNotifySignal(mWidget);
// These are needed so that the events will go to us and not our parent.
AddToEventMask(mWidget,
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
// Add in destroy callback
gtk_signal_connect(GTK_OBJECT(mCheckButton),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
InstallSignal((GtkWidget *)mCheckButton,
(gchar *)"toggled",
GTK_SIGNAL_FUNC(nsCheckButton::ToggledSignal));
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::SetState(const PRBool aState)
{
mState = aState;
if (mWidget && mCheckButton)
{
GtkToggleButton * item = GTK_TOGGLE_BUTTON(mCheckButton);
item->active = (gboolean) mState;
gtk_widget_queue_draw(GTK_WIDGET(item));
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::GetState(PRBool& aState)
{
aState = mState;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this Checkbox label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::SetLabel(const nsString& aText)
{
if (mWidget) {
NS_ALLOC_STR_BUF(label, aText, 256);
if (mLabel) {
gtk_label_set(GTK_LABEL(mLabel), label);
} else {
mLabel = gtk_label_new(label);
gtk_misc_set_alignment (GTK_MISC (mLabel), 0.0, 0.5);
gtk_container_add(GTK_CONTAINER(mCheckButton), mLabel);
gtk_widget_show(mLabel);
gtk_signal_connect(GTK_OBJECT(mLabel),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
}
NS_FREE_STR_BUF(label);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsCheckButton::GetLabel(nsString& aBuffer)
{
aBuffer.SetLength(0);
if (mWidget) {
char * text;
if (mLabel) {
gtk_label_get(GTK_LABEL(mLabel), &text);
aBuffer.Append(text);
}
}
return NS_OK;
}
/* virtual */ void
nsCheckButton::OnToggledSignal(const gboolean aState)
{
// Untoggle the sonofabitch
if (mWidget && mCheckButton)
{
GtkToggleButton * item = GTK_TOGGLE_BUTTON(mCheckButton);
item->active = !item->active;
gtk_widget_queue_draw(GTK_WIDGET(item));
}
}
//////////////////////////////////////////////////////////////////////
/* static */ gint
nsCheckButton::ToggledSignal(GtkWidget * aWidget,
gpointer aData)
{
NS_ASSERTION( nsnull != aWidget, "widget is null");
nsCheckButton * button = (nsCheckButton *) aData;
NS_ASSERTION( nsnull != button, "instance pointer is null");
button->OnToggledSignal(GTK_TOGGLE_BUTTON(aWidget)->active);
return PR_TRUE;
}
//////////////////////////////////////////////////////////////////////
// SetBackgroundColor for CheckButton
/*virtual*/
void nsCheckButton::SetBackgroundColorNative(GdkColor *aColorNor,
GdkColor *aColorBri,
GdkColor *aColorDark)
{
// use same style copy as SetFont
GtkStyle *style = gtk_style_copy(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0))->style);
style->bg[GTK_STATE_NORMAL]=*aColorNor;
// Mouse over button
style->bg[GTK_STATE_PRELIGHT]=*aColorBri;
// Button is down
style->bg[GTK_STATE_ACTIVE]=*aColorDark;
// other states too? (GTK_STATE_ACTIVE, GTK_STATE_PRELIGHT,
// GTK_STATE_SELECTED, GTK_STATE_INSENSITIVE)
gtk_widget_set_style(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0)), style);
// set style for eventbox too
gtk_widget_set_style(mWidget, style);
gtk_style_unref(style);
}

View File

@@ -0,0 +1,75 @@
/* -*- 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 nsCheckButton_h__
#define nsCheckButton_h__
#include "nsWidget.h"
#include "nsICheckButton.h"
/**
* Native GTK+ Checkbox wrapper
*/
class nsCheckButton : public nsWidget,
public nsICheckButton
{
public:
nsCheckButton();
virtual ~nsCheckButton();
NS_DECL_ISUPPORTS_INHERITED
// nsICheckButton part
NS_IMETHOD SetLabel(const nsString &aText);
NS_IMETHOD GetLabel(nsString &aBuffer);
NS_IMETHOD SetState(const PRBool aState);
NS_IMETHOD GetState(PRBool& aState);
virtual void OnToggledSignal(const gboolean aState);
protected:
NS_IMETHOD CreateNative(GtkObject *parentWindow);
virtual void InitCallbacks(char * aName = nsnull);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
// Sets background for checkbutton
virtual void SetBackgroundColorNative(GdkColor *aColorNor,
GdkColor *aColorBri,
GdkColor *aColorDark);
GtkWidget *mLabel;
GtkWidget *mCheckButton;
// We need to maintain our own state to be in sync with the
// gecko check controlling frame.
PRBool mState;
private:
static gint ToggledSignal(GtkWidget * aWidget,
gpointer aData);
};
#endif // nsCheckButton_h__

View File

@@ -0,0 +1,872 @@
/* -*- 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 "nsClipboard.h"
#include "nsCOMPtr.h"
#include "nsISupportsArray.h"
#include "nsIClipboardOwner.h"
#include "nsITransferable.h" // kTextMime
#include "nsISupportsPrimitives.h"
#include "nsIWidget.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsWidgetsCID.h"
#include "nsXPIDLString.h"
#include "nsPrimitiveHelpers.h"
#include "nsVoidArray.h"
// The class statics:
GtkWidget* nsClipboard::sWidget = 0;
#if defined(DEBUG_mcafee) || defined(DEBUG_pavlov)
#define DEBUG_CLIPBOARD
#endif
enum {
TARGET_NONE,
TARGET_TEXT_PLAIN,
TARGET_TEXT_XIF,
TARGET_TEXT_UNICODE,
TARGET_TEXT_HTML,
TARGET_AOLMAIL,
TARGET_IMAGE_PNG,
TARGET_IMAGE_JPEG,
TARGET_IMAGE_GIF,
// compatibility types
TARGET_UTF8,
TARGET_UNKNOWN,
TARGET_LAST
};
static GdkAtom sSelTypes[TARGET_LAST];
//-------------------------------------------------------------------------
//
// nsClipboard constructor
//
//-------------------------------------------------------------------------
nsClipboard::nsClipboard() : nsBaseClipboard()
{
#ifdef DEBUG_CLIPBOARD
g_print("nsClipboard::nsClipboard()\n");
#endif /* DEBUG_CLIPBOARD */
//NS_INIT_REFCNT();
mIgnoreEmptyNotification = PR_FALSE;
mClipboardOwner = nsnull;
mTransferable = nsnull;
mSelectionData.data = nsnull;
mSelectionData.length = 0;
// initialize the widget, etc we're binding to
Init();
}
// XXX if GTK's internal code changes this isn't going to work
// copied from gtk code because it is a static function we can't get to it.
// need to bug owen taylor about getting this code public.
typedef struct _GtkSelectionTargetList GtkSelectionTargetList;
struct _GtkSelectionTargetList {
GdkAtom selection;
GtkTargetList *list;
};
static const char *gtk_selection_handler_key = "gtk-selection-handlers";
void __gtk_selection_target_list_remove (GtkWidget *widget)
{
GtkSelectionTargetList *sellist;
GList *tmp_list;
GList *lists;
lists = (GList*)gtk_object_get_data (GTK_OBJECT (widget), gtk_selection_handler_key);
tmp_list = lists;
while (tmp_list)
{
sellist = (GtkSelectionTargetList*)tmp_list->data;
gtk_target_list_unref (sellist->list);
g_free (sellist);
tmp_list = tmp_list->next;
}
g_list_free (lists);
gtk_object_set_data (GTK_OBJECT (widget), gtk_selection_handler_key, NULL);
}
//-------------------------------------------------------------------------
//
// nsClipboard destructor
//
//-------------------------------------------------------------------------
nsClipboard::~nsClipboard()
{
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::~nsClipboard()\n");
#endif /* DEBUG_CLIPBOARD */
// Remove all our event handlers:
if (sWidget &&
(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);
nsClipboard *cb = (nsClipboard*)gtk_object_get_data(GTK_OBJECT(sWidget), "cb");
if (cb != nsnull)
{
NS_RELEASE(cb);
gtk_object_remove_data(GTK_OBJECT(sWidget), "cb");
}
if (sWidget)
{
gtk_widget_destroy(sWidget);
sWidget = nsnull;
}
}
//
// GTK Weirdness!
// This is here in the hope of being able to call
// gtk_selection_add_targets(w, GDK_SELECTION_PRIMARY,
// targets,
// 1);
// instead of
// gtk_selection_add_target(sWidget,
// GDK_SELECTION_PRIMARY,
// GDK_SELECTION_TYPE_STRING,
// GDK_SELECTION_TYPE_STRING);
// but it turns out that this changes the whole gtk selection model;
// when calling add_targets copy uses selection_clear_event and the
// data structure needs to be filled in in a way that we haven't
// figured out; when using add_target copy uses selection_get and
// the data structure is already filled in as much as it needs to be.
// Some gtk internals wizard will need to solve this mystery before
// we can use add_targets().
//static GtkTargetEntry targets[] = {
// { "strings n stuff", GDK_SELECTION_TYPE_STRING, GDK_SELECTION_TYPE_STRING }
//};
//
//-------------------------------------------------------------------------
void nsClipboard::Init(void)
{
#ifdef DEBUG_CLIPBOARD
g_print("nsClipboard::Init\n");
#endif
sSelTypes[TARGET_NONE] = GDK_NONE;
sSelTypes[TARGET_TEXT_PLAIN] = gdk_atom_intern(kTextMime, FALSE);
sSelTypes[TARGET_TEXT_XIF] = gdk_atom_intern(kXIFMime, FALSE);
sSelTypes[TARGET_TEXT_UNICODE] = gdk_atom_intern(kUnicodeMime, FALSE);
sSelTypes[TARGET_UTF8] = gdk_atom_intern("UTF8", FALSE);
sSelTypes[TARGET_TEXT_HTML] = gdk_atom_intern(kHTMLMime, FALSE);
sSelTypes[TARGET_AOLMAIL] = gdk_atom_intern(kAOLMailMime, FALSE);
sSelTypes[TARGET_IMAGE_PNG] = gdk_atom_intern(kPNGImageMime, FALSE);
sSelTypes[TARGET_IMAGE_JPEG] = gdk_atom_intern(kJPEGImageMime, FALSE);
sSelTypes[TARGET_IMAGE_GIF] = gdk_atom_intern(kGIFImageMime, FALSE);
// compatibility with other apps
// create invisible widget to use for the clipboard
sWidget = gtk_invisible_new();
// add the clipboard pointer to the widget so we can get it.
gtk_object_set_data(GTK_OBJECT(sWidget), "cb", this);
NS_ADDREF_THIS();
// Handle selection requests if we called gtk_selection_add_target:
gtk_signal_connect(GTK_OBJECT(sWidget), "selection_get",
GTK_SIGNAL_FUNC(nsClipboard::SelectionGetCB),
nsnull);
// When someone else takes the selection away:
gtk_signal_connect(GTK_OBJECT(sWidget), "selection_clear_event",
GTK_SIGNAL_FUNC(nsClipboard::SelectionClearCB),
nsnull);
// Set up the paste handler:
gtk_signal_connect(GTK_OBJECT(sWidget), "selection_received",
GTK_SIGNAL_FUNC(nsClipboard::SelectionReceivedCB),
nsnull);
}
//-------------------------------------------------------------------------
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("nsClipboard::SetNativeClipboardData(): no transferable!\n");
return NS_ERROR_FAILURE;
}
// are we already the owner?
if (gdk_selection_owner_get(GDK_SELECTION_PRIMARY) == sWidget->window)
{
// if so, clear all the targets
__gtk_selection_target_list_remove(sWidget);
// gtk_selection_remove_all(sWidget);
}
// we arn't already the owner, so we will become it
gint have_selection = gtk_selection_owner_set(sWidget,
GDK_SELECTION_PRIMARY,
GDK_CURRENT_TIME);
if (have_selection == 0)
return NS_ERROR_FAILURE;
// get flavor list that includes all flavors that can be written (including ones
// obtained through conversion)
nsCOMPtr<nsISupportsArray> flavorList;
nsresult errCode = mTransferable->FlavorsTransferableCanExport ( getter_AddRefs(flavorList) );
if ( NS_FAILED(errCode) )
return NS_ERROR_FAILURE;
PRUint32 cnt;
flavorList->Count(&cnt);
for ( PRUint32 i=0; i<cnt; ++i )
{
nsCOMPtr<nsISupports> genericFlavor;
flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) );
if ( currentFlavor ) {
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
gint format = GetFormat(flavorStr);
// add these types as selection targets
RegisterFormat(format);
}
}
mIgnoreEmptyNotification = PR_FALSE;
return NS_OK;
}
void nsClipboard::AddTarget(GdkAtom aAtom)
{
gtk_selection_add_target(sWidget,
GDK_SELECTION_PRIMARY,
aAtom, aAtom);
}
gint nsClipboard::GetFormat(const char* aMimeStr)
{
gint type = TARGET_NONE;
nsCAutoString mimeStr ( CBufDescriptor(NS_CONST_CAST(char*,aMimeStr), PR_TRUE, PL_strlen(aMimeStr)+1) );
#ifdef DEBUG_CLIPBOARD
g_print(" nsClipboard::GetFormat(%s)\n", aMimeStr);
#endif
if (mimeStr.Equals(kTextMime)) {
type = TARGET_TEXT_PLAIN;
} else if (mimeStr.Equals("STRING")) {
type = TARGET_TEXT_PLAIN;
} else if (mimeStr.Equals(kXIFMime)) {
type = TARGET_TEXT_XIF;
} else if (mimeStr.Equals(kUnicodeMime)) {
type = TARGET_TEXT_UNICODE;
} else if (mimeStr.Equals(kHTMLMime)) {
type = TARGET_TEXT_HTML;
} else if (mimeStr.Equals(kAOLMailMime)) {
type = TARGET_AOLMAIL;
} else if (mimeStr.Equals(kPNGImageMime)) {
type = TARGET_IMAGE_PNG;
} else if (mimeStr.Equals(kJPEGImageMime)) {
type = TARGET_IMAGE_JPEG;
} else if (mimeStr.Equals(kGIFImageMime)) {
type = TARGET_IMAGE_GIF;
}
#ifdef WE_DO_DND
else if (mimeStr.Equals(kDropFilesMime)) {
format = CF_HDROP;
} else {
format = ::RegisterClipboardFormat(aMimeStr);
}
#endif
return type;
}
void nsClipboard::RegisterFormat(gint format)
{
#ifdef DEBUG_CLIPBOARD
g_print(" nsClipboard::RegisterFormat(%s)\n", gdk_atom_name(sSelTypes[format]));
#endif
/* when doing the selection_add_target, each case should have the same last parameter
which matches the case match */
switch(format)
{
case TARGET_TEXT_PLAIN:
// text/plain (default)
AddTarget(sSelTypes[format]);
// STRING (what X uses)
AddTarget(GDK_SELECTION_TYPE_STRING);
break;
case TARGET_TEXT_XIF:
// text/xif (default)
AddTarget(sSelTypes[format]);
break;
case TARGET_TEXT_UNICODE:
// text/unicode (default)
AddTarget(sSelTypes[format]);
// UTF8 (what X uses)
AddTarget(sSelTypes[TARGET_UTF8]);
break;
case TARGET_TEXT_HTML:
// text/html (default)
AddTarget(sSelTypes[format]);
break;
case TARGET_AOLMAIL:
// text/aolmail (default)
AddTarget(sSelTypes[format]);
break;
case TARGET_IMAGE_PNG:
// image/png (default)
AddTarget(sSelTypes[format]);
break;
case TARGET_IMAGE_JPEG:
// image/jpeg (default)
AddTarget(sSelTypes[format]);
break;
case TARGET_IMAGE_GIF:
// image/gif (default)
AddTarget(sSelTypes[format]);
break;
default:
// if we don't match something above, then just add it like its something we know about...
AddTarget(sSelTypes[format]);
}
}
PRBool nsClipboard::DoRealConvert(GdkAtom type)
{
#ifdef DEBUG_CLIPBOARD
g_print(" nsClipboard::DoRealConvert(%li)\n {\n", type);
#endif
int e = 0;
// Set a flag saying that we're blocking waiting for the callback:
mBlocking = PR_TRUE;
//
// ask X what kind of data we can get
//
#ifdef DEBUG_CLIPBOARD
g_print(" Doing real conversion of atom type '%s'\n", gdk_atom_name(type));
#endif
gtk_selection_convert(sWidget,
GDK_SELECTION_PRIMARY,
type,
GDK_CURRENT_TIME);
// Now we need to wait until the callback comes in ...
// i is in case we get a runaway (yuck).
#ifdef DEBUG_CLIPBOARD
printf(" Waiting for the callback... mBlocking = %d\n", mBlocking);
#endif /* DEBUG_CLIPBOARD */
for (e=0; mBlocking == PR_TRUE && e < 1000; ++e)
{
gtk_main_iteration_do(PR_TRUE);
}
#ifdef DEBUG_CLIPBOARD
g_print(" }\n");
#endif
if (mSelectionData.length > 0)
return PR_TRUE;
return PR_FALSE;
}
/* return PR_TRUE if we have converted or PR_FALSE if we havn't and need to keep being called */
PRBool nsClipboard::DoConvert(gint format)
{
#ifdef DEBUG_CLIPBOARD
g_print(" nsClipboard::DoConvert(%s)\n", gdk_atom_name(sSelTypes[format]));
#endif
/* when doing the selection_add_target, each case should have the same last parameter
which matches the case match */
PRBool r = PR_FALSE;
switch(format)
{
case TARGET_TEXT_PLAIN:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
r = DoRealConvert(GDK_SELECTION_TYPE_STRING);
if (r) return r;
break;
case TARGET_TEXT_XIF:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
case TARGET_TEXT_UNICODE:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
r = DoRealConvert(sSelTypes[TARGET_UTF8]);
if (r) return r;
break;
case TARGET_TEXT_HTML:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
case TARGET_AOLMAIL:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
case TARGET_IMAGE_PNG:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
case TARGET_IMAGE_JPEG:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
case TARGET_IMAGE_GIF:
r = DoRealConvert(sSelTypes[format]);
if (r) return r;
break;
default:
g_print("DoConvert called with bogus format\n");
}
return r;
}
//-------------------------------------------------------------------------
//
// The blocking Paste routine
//
//-------------------------------------------------------------------------
NS_IMETHODIMP
nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable)
{
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::GetNativeClipboardData()\n");
#endif /* DEBUG_CLIPBOARD */
// make sure we have a good transferable
if (nsnull == aTransferable) {
printf(" GetNativeClipboardData: Transferable is null!\n");
return NS_ERROR_FAILURE;
}
// get flavor list that includes all acceptable flavors (including ones obtained through
// conversion)
nsCOMPtr<nsISupportsArray> flavorList;
nsresult errCode = aTransferable->FlavorsTransferableCanImport ( getter_AddRefs(flavorList) );
if ( NS_FAILED(errCode) )
return NS_ERROR_FAILURE;
// Walk through flavors and see which flavor matches the one being pasted:
PRUint32 cnt;
flavorList->Count(&cnt);
nsCAutoString foundFlavor;
for ( PRUint32 i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> genericFlavor;
flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) );
if ( currentFlavor ) {
nsXPIDLCString flavorStr;
currentFlavor->ToString ( getter_Copies(flavorStr) );
gint format = GetFormat(flavorStr);
if (DoConvert(format)) {
foundFlavor = flavorStr;
break;
}
}
}
#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.
//
#if 0
// pinkerton - we have the flavor already from above, so we don't need
// to re-derrive it.
nsString *name = new nsString((const char*)gdk_atom_name(mSelectionData.type));
int format = GetFormat(*name);
df->SetString((const char*)gdk_atom_name(sSelTypes[format]));
#endif
nsCOMPtr<nsISupports> genericDataWrapper;
nsPrimitiveHelpers::CreatePrimitiveForData ( foundFlavor, mSelectionData.data, mSelectionData.length, getter_AddRefs(genericDataWrapper) );
aTransferable->SetTransferData(foundFlavor,
genericDataWrapper,
mSelectionData.length);
//delete name;
// transferable is now copying the data, so we can free it.
// g_free(mSelectionData.data);
mSelectionData.data = nsnull;
mSelectionData.length = 0;
return NS_OK;
}
/**
* Called when the data from a paste comes in (recieved from gdk_selection_convert)
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aTime time the selection was requested
*/
void
nsClipboard::SelectionReceivedCB (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SelectionReceivedCB\n {\n");
#endif /* DEBUG_CLIPBOARD */
nsClipboard *cb =(nsClipboard *)gtk_object_get_data(GTK_OBJECT(aWidget),
"cb");
if (!cb)
{
g_print("no clipboard found.. this is bad.\n");
return;
}
cb->SelectionReceiver(aWidget, aSelectionData);
#ifdef DEBUG_CLIPBOARD
g_print(" }\n");
#endif
}
/**
* local method (called from nsClipboard::SelectionReceivedCB)
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
*/
void
nsClipboard::SelectionReceiver (GtkWidget *aWidget,
GtkSelectionData *aSD)
{
gint type;
mBlocking = PR_FALSE;
if (aSD->length < 0)
{
printf(" Error retrieving selection: length was %d\n",
aSD->length);
return;
}
type = TARGET_NONE;
for (int i=0; i < TARGET_LAST; i++)
{
if (sSelTypes[i] == aSD->type)
{
type = i;
break;
}
}
switch (type)
{
case GDK_TARGET_STRING:
case TARGET_UTF8:
case TARGET_TEXT_PLAIN:
case TARGET_TEXT_XIF:
case TARGET_TEXT_UNICODE:
case TARGET_TEXT_HTML:
#ifdef DEBUG_CLIPBOARD
g_print(" Copying mSelectionData pointer -- ");
#endif
mSelectionData = *aSD;
mSelectionData.data = g_new(guchar, aSD->length + 1);
#ifdef DEBUG_CLIPBOARD
g_print(" Data = %s\n Length = %i\n", aSD->data, aSD->length);
#endif
memcpy(mSelectionData.data,
aSD->data,
aSD->length);
// Null terminate in case anyone cares,
// and so we can print the string for debugging:
mSelectionData.data[aSD->length] = '\0';
mSelectionData.length = aSD->length;
return;
default:
mSelectionData = *aSD;
mSelectionData.data = g_new(guchar, aSD->length + 1);
memcpy(mSelectionData.data,
aSD->data,
aSD->length);
mSelectionData.length = aSD->length;
return;
}
}
/**
* 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.
*/
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;
}
NS_IMETHODIMP
nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList, PRBool * outResult)
{
*outResult = PR_TRUE; // say we always do.
return NS_OK;
}
/**
* This is the callback which is called when another app
* requests the selection.
*
* @param widget The widget
* @param aSelectionData Selection data
* @param info Value passed in from the callback init
* @param time Time when the selection request came in
*/
void nsClipboard::SelectionGetCB(GtkWidget *widget,
GtkSelectionData *aSelectionData,
guint aInfo,
guint aTime)
{
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::SelectionGetCB\n");
#endif /* DEBUG_CLIPBOARD */
nsClipboard *cb = (nsClipboard *)gtk_object_get_data(GTK_OBJECT(widget),
"cb");
void *clipboardData;
PRUint32 dataLength;
nsresult rv;
// Make sure we have a transferable:
if (!cb->mTransferable) {
printf("Clipboard has no transferable!\n");
return;
}
#ifdef DEBUG_CLIPBOARD
g_print(" aInfo == %d -", aInfo);
#endif
char* dataFlavor = nsnull;
// switch aInfo (atom) to our enum
int type = (int)aInfo;
for (int i=0; i < TARGET_LAST; i++)
{
if (sSelTypes[i] == aInfo)
{
type = i;
break;
}
}
switch(type)
{
case GDK_TARGET_STRING:
case TARGET_TEXT_PLAIN:
dataFlavor = kTextMime;
break;
case TARGET_TEXT_XIF:
dataFlavor = kXIFMime;
break;
case TARGET_TEXT_UNICODE:
case TARGET_UTF8:
dataFlavor = kUnicodeMime;
break;
case TARGET_TEXT_HTML:
dataFlavor = kHTMLMime;
break;
case TARGET_AOLMAIL:
dataFlavor = kAOLMailMime;
break;
case TARGET_IMAGE_PNG:
dataFlavor = kPNGImageMime;
break;
case TARGET_IMAGE_JPEG:
dataFlavor = kJPEGImageMime;
break;
case TARGET_IMAGE_GIF:
dataFlavor = kGIFImageMime;
break;
default:
{
/* handle outside things */
}
}
#ifdef DEBUG_CLIPBOARD
g_print("- aInfo is for %s\n", gdk_atom_name(aInfo));
#endif
// Get data out of transferable.
nsCOMPtr<nsISupports> genericDataWrapper;
rv = cb->mTransferable->GetTransferData(dataFlavor,
getter_AddRefs(genericDataWrapper),
&dataLength);
nsPrimitiveHelpers::CreateDataFromPrimitive ( dataFlavor, genericDataWrapper, &clipboardData, dataLength );
if (NS_SUCCEEDED(rv) && clipboardData && dataLength > 0) {
size_t size = 1;
// find the number of bytes in the data for the below thing
// size_t size = sizeof((void*)((unsigned char)clipboardData[0]));
// g_print("************ ***************** ******************* %i\n", size);
gtk_selection_data_set(aSelectionData,
aInfo, size*8,
(unsigned char *)clipboardData,
dataLength);
nsCRT::free ( NS_REINTERPRET_CAST(char*, clipboardData) );
}
else
printf("Transferable didn't support the data flavor\n");
}
/**
* Called when another app requests selection ownership
*
* @param aWidget the widget
* @param aEvent the GdkEvent for the selection
* @param aData value passed in from the callback init
*/
void nsClipboard::SelectionClearCB(GtkWidget *aWidget,
GdkEventSelection *aEvent,
gpointer aData)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SelectionClearCB\n");
#endif /* DEBUG_CLIPBOARD */
nsClipboard *cb = (nsClipboard *)gtk_object_get_data(GTK_OBJECT(aWidget),
"cb");
cb->EmptyClipboard();
}
/**
* The routine called when another app asks for the content of the selection
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aData value passed in from the callback init
*/
void
nsClipboard::SelectionRequestCB (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
gpointer aData)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SelectionRequestCB\n");
#endif /* DEBUG_CLIPBOARD */
}
/**
* ...
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aData value passed in from the callback init
*/
void
nsClipboard::SelectionNotifyCB (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
gpointer aData)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SelectionNotifyCB\n");
#endif /* DEBUG_CLIPBOARD */
}

View File

@@ -0,0 +1,132 @@
/* -*- 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 nsClipboard_h__
#define nsClipboard_h__
#include "nsBaseClipboard.h"
#include <gtk/gtk.h>
#include <gtk/gtkinvisible.h>
class nsITransferable;
class nsIClipboardOwner;
class nsIWidget;
/**
* Native Gtk Clipboard wrapper
*/
class nsClipboard : public nsBaseClipboard
{
public:
nsClipboard();
virtual ~nsClipboard();
// nsIClipboard
NS_IMETHOD ForceDataToClipboard();
NS_IMETHOD HasDataMatchingFlavors(nsISupportsArray* aFlavorList, PRBool * outResult);
// invisible widget. also used by dragndrop
static GtkWidget *sWidget;
protected:
NS_IMETHOD SetNativeClipboardData();
NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable);
PRBool mIgnoreEmptyNotification;
void AddTarget(GdkAtom aAtom);
gint GetFormat(const char* aMimeStr);
void RegisterFormat(gint format);
PRBool DoRealConvert(GdkAtom type);
PRBool DoConvert(gint format);
void Init(void);
// Used for communicating pasted data
// from the asynchronous X routines back to a blocking paste:
GtkSelectionData mSelectionData;
PRBool mBlocking;
void SelectionReceiver(GtkWidget *aWidget,
GtkSelectionData *aSD);
/**
* This is the callback which is called when another app
* requests the selection.
*
* @param widget The widget
* @param aSelectionData Selection data
* @param info Value passed in from the callback init
* @param time Time when the selection request came in
*/
static void SelectionGetCB(GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint /*info*/,
guint /*time*/);
/**
* Called when another app requests selection ownership
*
* @param aWidget the widget
* @param aEvent the GdkEvent for the selection
* @param aData value passed in from the callback init
*/
static void SelectionClearCB(GtkWidget *aWidget,
GdkEventSelection *aEvent,
gpointer aData);
/**
* The routine called when another app asks for the content of the selection
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aData value passed in from the callback init
*/
static void SelectionRequestCB(GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
gpointer data);
/**
* Called when the data from a paste comes in
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aTime time the selection was requested
*/
static void SelectionReceivedCB(GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime);
static void SelectionNotifyCB(GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
gpointer aData);
};
#endif // nsClipboard_h__

View File

@@ -0,0 +1,357 @@
/* -*- 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 <gtk/gtk.h>
#include "nsComboBox.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#define DBG 0
#define INITIAL_MAX_ITEMS 128
#define ITEMS_GROWSIZE 128
NS_IMPL_ADDREF_INHERITED(nsComboBox, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsComboBox, nsWidget)
NS_IMPL_QUERY_INTERFACE3(nsComboBox, nsIComboBox, nsIListWidget, nsIWidget)
//-------------------------------------------------------------------------
//
// nsComboBox constructor
//
//-------------------------------------------------------------------------
nsComboBox::nsComboBox() : nsWidget(), nsIListWidget(), nsIComboBox()
{
NS_INIT_REFCNT();
mMultiSelect = PR_FALSE;
mItems = nsnull;
mNumItems = 0;
}
//-------------------------------------------------------------------------
//
// nsComboBox:: destructor
//
//-------------------------------------------------------------------------
nsComboBox::~nsComboBox()
{
if (mItems) {
for (GList *items = mItems; items; items = (GList*) g_list_next(items)){
g_free(items->data);
}
g_list_free(mItems);
}
gtk_widget_destroy(mCombo);
}
void nsComboBox::InitCallbacks(char * aName)
{
InstallButtonPressSignal(mWidget);
InstallButtonReleaseSignal(mWidget);
InstallEnterNotifySignal(mWidget);
InstallLeaveNotifySignal(mWidget);
// These are needed so that the events will go to us and not our parent.
AddToEventMask(mWidget,
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
}
//-------------------------------------------------------------------------
//
// initializer
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::SetMultipleSelection(PRBool aMultipleSelections)
{
mMultiSelect = aMultipleSelections;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// AddItemAt
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
{
NS_ALLOC_STR_BUF(val, aItem, 256);
mItems = g_list_insert( mItems, g_strdup(val), aPosition );
mNumItems++;
if (mCombo) {
gtk_combo_set_popdown_strings( GTK_COMBO( mCombo ), mItems );
}
NS_FREE_STR_BUF(val);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Finds an item at a postion
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::FindItem(nsString &aItem, PRInt32 aStartPos)
{
NS_ALLOC_STR_BUF(val, aItem, 256);
int i;
PRInt32 inx = -1;
GList *items = g_list_nth(mItems, aStartPos);
for(i=0; items != NULL; items = (GList *) g_list_next(items), i++ )
{
if(!strcmp(val, (gchar *) items->data))
{
inx = i;
break;
}
}
NS_FREE_STR_BUF(val);
return inx;
}
//-------------------------------------------------------------------------
//
// CountItems - Get Item Count
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetItemCount()
{
return (PRInt32)mNumItems;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsComboBox::RemoveItemAt(PRInt32 aPosition)
{
if (aPosition >= 0 && aPosition < mNumItems) {
g_free(g_list_nth(mItems, aPosition)->data);
mItems = g_list_remove_link(mItems, g_list_nth(mItems, aPosition));
mNumItems--;
if (mCombo) {
gtk_combo_set_popdown_strings(GTK_COMBO( mCombo ), mItems);
}
return PR_TRUE;
}
else
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsComboBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
{
if (aPosition >= 0 && aPosition < mNumItems) {
anItem = (gchar *) g_list_nth(mItems, aPosition)->data;
return PR_TRUE;
}
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// Gets the selected of selected item
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::GetSelectedItem(nsString& aItem)
{
aItem.Truncate();
if (mCombo) {
aItem = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(mCombo)->entry));
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Gets the list of selected otems
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetSelectedIndex()
{
nsString nsstring;
GetSelectedItem(nsstring);
return FindItem(nsstring, 0);
}
//-------------------------------------------------------------------------
//
// SelectItem
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::SelectItem(PRInt32 aPosition)
{
GList *pos;
if (!mItems)
return NS_ERROR_FAILURE;
pos = g_list_nth(mItems, aPosition);
if (!pos)
return NS_ERROR_FAILURE;
if (mCombo) {
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(mCombo)->entry),
(gchar *) pos->data);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// GetSelectedCount
//
//-------------------------------------------------------------------------
PRInt32 nsComboBox::GetSelectedCount()
{
if (!mMultiSelect) {
PRInt32 inx = GetSelectedIndex();
return (inx == -1? 0 : 1);
} else {
return 0;
}
}
//-------------------------------------------------------------------------
//
// GetSelectedIndices
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
{
// this is an error
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
//
// Deselect
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::Deselect()
{
if (mMultiSelect) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Create the native GtkCombo widget
//
//-------------------------------------------------------------------------
NS_METHOD nsComboBox::CreateNative(GtkObject *parentWindow)
{
mWidget = ::gtk_event_box_new();
::gtk_widget_set_name(mWidget, "nsComboBox");
mCombo = ::gtk_combo_new();
gtk_widget_show(mCombo);
/* make the stuff uneditable */
gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(mCombo)->entry), PR_FALSE);
gtk_signal_connect(GTK_OBJECT(mCombo),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
gtk_signal_connect(GTK_OBJECT(GTK_COMBO(mCombo)->popwin),
"unmap",
GTK_SIGNAL_FUNC(UnmapSignal),
this);
gtk_container_add(GTK_CONTAINER(mWidget), mCombo);
return NS_OK;
}
void
nsComboBox::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mCombo) {
mCombo = nsnull;
}
else {
nsWidget::OnDestroySignal(aGtkWidget);
}
}
gint
nsComboBox::UnmapSignal(GtkWidget* aGtkWidget, nsComboBox* aCombo)
{
if (!aCombo) return PR_FALSE;
aCombo->OnUnmapSignal(aGtkWidget);
return PR_TRUE;
}
void
nsComboBox::OnUnmapSignal(GtkWidget * aWidget)
{
if (!aWidget) return;
// Generate a NS_CONTROL_CHANGE event and send it to the frame
nsGUIEvent event;
event.eventStructType = NS_GUI_EVENT;
nsPoint point(0,0);
InitEvent(event, NS_CONTROL_CHANGE, &point);
DispatchWindowEvent(&event);
}
//-------------------------------------------------------------------------
//
// Get handle for style
//
//-------------------------------------------------------------------------
/*virtual*/
void nsComboBox::SetFontNative(GdkFont *aFont)
{
GtkStyle *style = gtk_style_copy(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0))->style);
// gtk_style_copy ups the ref count of the font
gdk_font_unref (style->font);
style->font = aFont;
gdk_font_ref(style->font);
gtk_widget_set_style(GTK_BIN (mWidget)->child, style);
gtk_style_unref(style);
}

View File

@@ -0,0 +1,75 @@
/* -*- 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 nsComboBox_h__
#define nsComboBox_h__
#include "nsWidget.h"
#include "nsIComboBox.h"
/**
* Native GTK+ Listbox wrapper
*/
class nsComboBox : public nsWidget,
public nsIListWidget,
public nsIComboBox
{
public:
nsComboBox();
virtual ~nsComboBox();
NS_DECL_ISUPPORTS_INHERITED
// 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() ;
// nsIComboBox interface
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections);
PRInt32 GetSelectedCount();
NS_IMETHOD GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
virtual void SetFontNative(GdkFont *aFont);
protected:
NS_IMETHOD CreateNative(GtkObject *parentWindow);
virtual void InitCallbacks(char * aName = nsnull);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
virtual void OnUnmapSignal(GtkWidget* aWidget);
static gint UnmapSignal(GtkWidget* aGtkWidget, nsComboBox* aCombo);
GtkWidget *mCombo; /* workaround for gtkcombo bug */
GList *mItems;
PRBool mMultiSelect;
int mNumItems;
};
#endif // nsComboBox_h__

View File

@@ -0,0 +1,744 @@
/* -*- 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 <gtk/gtk.h>
#include "nsContextMenu.h"
#include "nsIComponentManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIMenuBar.h"
#include "nsIMenuItem.h"
#include "nsIMenuListener.h"
#include "nsString.h"
#include "nsGtkEventHandler.h"
#include "nsCOMPtr.h"
#include "nsWidgetsCID.h"
static NS_DEFINE_CID(kMenuCID, NS_MENU_CID);
static NS_DEFINE_CID(kMenuItemCID, NS_MENUITEM_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
//-------------------------------------------------------------------------
nsresult nsContextMenu::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(nsIMenu::GetIID())) {
*aInstancePtr = (void*)(nsIMenu*) this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)(nsIMenu*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIMenuListener::GetIID())) {
*aInstancePtr = (void*)(nsIMenuListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
//-------------------------------------------------------------------------
NS_IMPL_ADDREF(nsContextMenu)
NS_IMPL_RELEASE(nsContextMenu)
//-------------------------------------------------------------------------
//
// nsContextMenu constructor
//
//-------------------------------------------------------------------------
nsContextMenu::nsContextMenu()
{
NS_INIT_REFCNT();
mNumMenuItems = 0;
mMenu = nsnull;
mParent = nsnull;
mListener = nsnull;
mConstructCalled = PR_FALSE;
mDOMNode = nsnull;
mWebShell = nsnull;
mDOMElement = nsnull;
mAlignment = "topleft";
mAnchorAlignment = "none";
}
//-------------------------------------------------------------------------
//
// nsContextMenu destructor
//
//-------------------------------------------------------------------------
nsContextMenu::~nsContextMenu()
{
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::Create(nsISupports *aParent,
const nsString& anAlignment,
const nsString& anAnchorAlignment)
{
if(aParent)
{
nsIWidget *parent = nsnull;
aParent->QueryInterface(nsIWidget::GetIID(), (void**) &parent);
if(parent)
{
mParent = parent;
NS_RELEASE(parent);
}
}
mAlignment = anAlignment;
mAnchorAlignment = anAnchorAlignment;
mMenu = gtk_menu_new();
gtk_signal_connect (GTK_OBJECT (mMenu), "map",
GTK_SIGNAL_FUNC(menu_map_handler),
this);
gtk_signal_connect (GTK_OBJECT (mMenu), "unmap",
GTK_SIGNAL_FUNC(menu_unmap_handler),
this);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::GetParent(nsISupports*& aParent)
{
aParent = nsnull;
if (nsnull != mParent) {
return mParent->QueryInterface(kISupportsIID,
(void**)&aParent);
}
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::AddItem(nsISupports * aItem)
{
if(aItem)
{
nsIMenuItem * menuitem = nsnull;
aItem->QueryInterface(nsIMenuItem::GetIID(),
(void**)&menuitem);
if(menuitem)
{
AddMenuItem(menuitem); // nsMenu now owns this
NS_RELEASE(menuitem);
}
else
{
nsIMenu * menu = nsnull;
aItem->QueryInterface(nsIMenu::GetIID(),
(void**)&menu);
if(menu)
{
AddMenu(menu); // nsMenu now owns this
NS_RELEASE(menu);
}
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::AddMenuItem(nsIMenuItem * aMenuItem)
{
GtkWidget *widget;
void *voidData;
aMenuItem->GetNativeData(voidData);
widget = GTK_WIDGET(voidData);
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
// XXX add aMenuItem to internal data structor list
// Need to be adding an nsISupports *, not nsIMenuItem *
nsISupports * supports = nsnull;
aMenuItem->QueryInterface(kISupportsIID,
(void**)&supports);
{
mMenuItemVoidArray.AppendElement(supports);
mNumMenuItems++;
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::AddMenu(nsIMenu * aMenu)
{
nsString Label;
GtkWidget *newmenu=nsnull;
char *labelStr;
void *voidData=NULL;
aMenu->GetLabel(Label);
labelStr = Label.ToNewCString();
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuItemCID,
nsnull,
nsIMenuItem::GetIID(),
(void**)&pnsMenuItem);
if (NS_OK == rv) {
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, labelStr, PR_FALSE); //PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
void * menuitem = nsnull;
pnsMenuItem->GetNativeData(menuitem);
voidData = NULL;
aMenu->GetNativeData(&voidData);
newmenu = GTK_WIDGET(voidData);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), newmenu);
NS_RELEASE(pnsMenuItem);
}
nsCRT::free(labelStr);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::AddSeparator()
{
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(
kMenuItemCID, nsnull, nsIMenuItem::GetIID(), (void**)&pnsMenuItem);
if (NS_OK == rv) {
nsString tmp = "separator";
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, tmp, PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
NS_RELEASE(pnsMenuItem);
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::GetItemCount(PRUint32 &aCount)
{
// this should be right.. does it need to be +1 ?
aCount = g_list_length(GTK_MENU_SHELL(mMenu)->children);
//g_print("nsMenu::GetItemCount = %i\n", aCount);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::GetItemAt(const PRUint32 aCount, nsISupports *& aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::InsertItemAt(const PRUint32 aCount, nsISupports * aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::InsertSeparator(const PRUint32 aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::RemoveItem(const PRUint32 aCount)
{
#if 0
// this may work here better than Removeall(), but i'm not sure how to test this one
nsISupports *item = mMenuItemVoidArray[aPos];
delete item;
mMenuItemVoidArray.RemoveElementAt(aPos);
#endif
/*
gtk_menu_shell_remove (GTK_MENU_SHELL (mMenu), item);
nsCRT::free(labelStr);
voidData = NULL;
aMenu->GetNativeData(&voidData);
newmenu = GTK_WIDGET(voidData);
gtk_menu_item_remove_submenu (GTK_MENU_ITEM (item));
*/
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::RemoveAll()
{
//g_print("nsMenu::RemoveAll()\n");
#undef DEBUG_pavlov
#ifdef DEBUG_pavlov
// this doesn't work quite right, but this is about all that should really be needed
int i=0;
nsIMenu *menu = nsnull;
nsIMenuItem *menuitem = nsnull;
nsISupports *item = nsnull;
for (i=mMenuItemVoidArray.Count(); i>0; i--)
{
item = (nsISupports*)mMenuItemVoidArray[i-1];
if(nsnull != item)
{
if (NS_OK == item->QueryInterface(nsIMenuItem::GetIID(), (void**)&menuitem))
{
// we do this twice because we have to do it once for QueryInterface,
// then we want to get rid of it.
// g_print("remove nsMenuItem\n");
NS_RELEASE(menuitem);
NS_RELEASE(item);
menuitem = nsnull;
} else if (NS_OK == item->QueryInterface(nsIMenu::GetIID(), (void**)&menu)) {
#ifdef NOISY_MENUS
g_print("remove nsMenu\n");
#endif
NS_RELEASE(menu);
NS_RELEASE(item);
menu = nsnull;
}
// mMenuItemVoidArray.RemoveElementAt(i-1);
}
}
mMenuItemVoidArray.Clear();
return NS_OK;
#else
for (int i = mMenuItemVoidArray.Count(); i > 0; i--) {
if(nsnull != mMenuItemVoidArray[i-1]) {
nsIMenuItem * menuitem = nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(nsIMenuItem::GetIID(),
(void**)&menuitem);
if(menuitem) {
void *gtkmenuitem = nsnull;
menuitem->GetNativeData(gtkmenuitem);
if (gtkmenuitem) {
gtk_widget_ref(GTK_WIDGET(gtkmenuitem));
//gtk_widget_destroy(GTK_WIDGET(gtkmenuitem));
g_print("%p, %p\n",
GTK_WIDGET(GTK_CONTAINER(GTK_MENU_SHELL(GTK_MENU(mMenu)))),
GTK_WIDGET(GTK_WIDGET(gtkmenuitem)->parent));
gtk_container_remove(GTK_CONTAINER(GTK_MENU_SHELL(GTK_MENU(mMenu))),
GTK_WIDGET(gtkmenuitem));
}
} else {
nsIMenu * menu= nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(nsIMenu::GetIID(),
(void**)&menu);
if(menu)
{
void * gtkmenu = nsnull;
menu->GetNativeData(&gtkmenu);
if(gtkmenu){
g_print("nsMenu::RemoveAll() trying to remove nsMenu");
//gtk_menu_item_remove_submenu (GTK_MENU_ITEM (item));
}
}
}
}
}
//g_print("end RemoveAll\n");
return NS_OK;
#endif
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::GetNativeData(void ** aData)
{
*aData = (void *)mMenu;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::AddMenuListener(nsIMenuListener * aMenuListener)
{
mListener = aMenuListener;
NS_ADDREF(mListener);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::RemoveMenuListener(nsIMenuListener * aMenuListener)
{
if (aMenuListener == mListener) {
NS_IF_RELEASE(mListener);
}
return NS_OK;
}
//-------------------------------------------------------------------------
// nsIMenuListener interface
//-------------------------------------------------------------------------
nsEventStatus nsContextMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
if (nsnull != mListener) {
mListener->MenuSelected(aMenuEvent);
}
return nsEventStatus_eIgnore;
}
void menu_popup_position(GtkMenu *menu,
gint *x,
gint *y,
gpointer data)
{
nsContextMenu *cm = (nsContextMenu*)data;
*x = cm->GetX();
*y = cm->GetY();
}
nsEventStatus nsContextMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
{
MenuConstruct(aMenuEvent,
mParent,
mDOMNode,
mWebShell);
//GtkWidget *parent = GTK_WIDGET(mParent->GetNativeData(NS_NATIVE_WIDGET));
gtk_menu_popup (GTK_MENU(mMenu),
(GtkWidget*)nsnull, (GtkWidget*)nsnull,
menu_popup_position,
this, 1, GDK_CURRENT_TIME);
/*
if (nsnull != mListener) {
mListener->MenuSelected(aMenuEvent);
}
*/
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsIMenuItem * nsContextMenu::FindMenuItem(nsIContextMenu * aMenu, PRUint32 aId)
{
return nsnull;
}
//-------------------------------------------------------------------------
nsEventStatus nsContextMenu::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
if (nsnull != mListener) {
mListener->MenuDeselected(aMenuEvent);
}
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsContextMenu::MenuConstruct(const nsMenuEvent &aMenuEvent,
nsIWidget *aParentWindow,
void *menuNode,
void *aWebShell)
{
//g_print("nsMenu::MenuConstruct called \n");
if(menuNode){
SetDOMNode((nsIDOMNode*)menuNode);
}
if(!aWebShell){
aWebShell = mWebShell;
}
// First open the menu.
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mDOMNode);
if (domElement)
domElement->SetAttribute("open", "true");
// Begin menuitem inner loop
nsCOMPtr<nsIDOMNode> menuitemNode;
((nsIDOMNode*)mDOMNode)->GetFirstChild(getter_AddRefs(menuitemNode));
unsigned short menuIndex = 0;
while (menuitemNode) {
nsCOMPtr<nsIDOMElement> menuitemElement(do_QueryInterface(menuitemNode));
if (menuitemElement) {
nsString menuitemNodeType;
nsString menuitemName;
menuitemElement->GetNodeName(menuitemNodeType);
if (menuitemNodeType.Equals("menuitem")) {
// LoadMenuItem
LoadMenuItem(this,
menuitemElement,
menuitemNode,
menuIndex,
(nsIWebShell*)aWebShell);
} else if (menuitemNodeType.Equals("separator")) {
AddSeparator();
} else if (menuitemNodeType.Equals("menu")) {
// Load a submenu
LoadSubMenu(this, menuitemElement, menuitemNode);
}
}
++menuIndex;
nsCOMPtr<nsIDOMNode> oldmenuitemNode(menuitemNode);
oldmenuitemNode->GetNextSibling(getter_AddRefs(menuitemNode));
} // end menu item innner loop
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsContextMenu::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
// Close the node.
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mDOMNode);
if (domElement)
domElement->RemoveAttribute("open");
//g_print("nsMenu::MenuDestruct called \n");
mConstructCalled = PR_FALSE;
RemoveAll();
return nsEventStatus_eIgnore;
}
//----------------------------------------
void nsContextMenu::LoadMenuItem(nsIMenu *pParentMenu,
nsIDOMElement *menuitemElement,
nsIDOMNode *menuitemNode,
unsigned short menuitemIndex,
nsIWebShell *aWebShell)
{
static const char* NS_STRING_TRUE = "true";
nsString disabled;
nsString menuitemName;
nsString menuitemCmd;
menuitemElement->GetAttribute(nsAutoString("disabled"), disabled);
menuitemElement->GetAttribute(nsAutoString("name"), menuitemName);
menuitemElement->GetAttribute(nsAutoString("cmd"), menuitemCmd);
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuItemCID,
nsnull,
nsIMenuItem::GetIID(),
(void**)&pnsMenuItem);
if (NS_OK == rv) {
pnsMenuItem->Create(pParentMenu, menuitemName, PR_FALSE);
nsISupports * supports = nsnull;
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
pParentMenu->AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
if(disabled == NS_STRING_TRUE) {
pnsMenuItem->SetEnabled(PR_FALSE);
}
// Create MenuDelegate - this is the intermediator inbetween
// the DOM node and the nsIMenuItem
// The nsWebShellWindow wacthes for Document changes and then notifies the
// the appropriate nsMenuDelegate object
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(menuitemNode));
if (!domElement) {
//return NS_ERROR_FAILURE;
return;
}
nsAutoString cmdAtom("onclick");
nsString cmdName;
domElement->GetAttribute(cmdAtom, cmdName);
pnsMenuItem->SetCommand(cmdName);
// DO NOT use passed in webshell because of messed up windows dynamic loading
// code.
pnsMenuItem->SetWebShell(mWebShell);
pnsMenuItem->SetDOMElement(domElement);
NS_RELEASE(pnsMenuItem);
}
return;
}
//----------------------------------------
void nsContextMenu::LoadSubMenu(nsIMenu *pParentMenu,
nsIDOMElement *menuElement,
nsIDOMNode *menuNode)
{
nsString menuName;
menuElement->GetAttribute(nsAutoString("name"), menuName);
//printf("Creating Menu [%s] \n", menuName.ToNewCString()); // this leaks
// Create nsMenu
nsIMenu * pnsMenu = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuCID,
nsnull,
nsIMenu::GetIID(),
(void**)&pnsMenu);
if (NS_OK == rv) {
// Call Create
nsISupports * supports = nsnull;
pParentMenu->QueryInterface(kISupportsIID, (void**) &supports);
pnsMenu->Create(supports, menuName);
NS_RELEASE(supports); // Balance QI
// Set nsMenu Name
pnsMenu->SetLabel(menuName);
supports = nsnull;
pnsMenu->QueryInterface(kISupportsIID, (void**) &supports);
pParentMenu->AddItem(supports); // parent takes ownership
NS_RELEASE(supports);
pnsMenu->SetWebShell(mWebShell);
pnsMenu->SetDOMNode(menuNode);
/*
// Begin menuitem inner loop
unsigned short menuIndex = 0;
nsCOMPtr<nsIDOMNode> menuitemNode;
menuNode->GetFirstChild(getter_AddRefs(menuitemNode));
while (menuitemNode) {
nsCOMPtr<nsIDOMElement> menuitemElement(do_QueryInterface(menuitemNode));
if (menuitemElement) {
nsString menuitemNodeType;
menuitemElement->GetNodeName(menuitemNodeType);
#ifdef DEBUG_saari
printf("Type [%s] %d\n", menuitemNodeType.ToNewCString(), menuitemNodeType.Equals("separator"));
#endif
if (menuitemNodeType.Equals("menuitem")) {
// Load a menuitem
LoadMenuItem(pnsMenu, menuitemElement, menuitemNode, menuIndex, mWebShell);
} else if (menuitemNodeType.Equals("separator")) {
pnsMenu->AddSeparator();
} else if (menuitemNodeType.Equals("menu")) {
// Add a submenu
LoadSubMenu(pnsMenu, menuitemElement, menuitemNode);
}
}
++menuIndex;
nsCOMPtr<nsIDOMNode> oldmenuitemNode(menuitemNode);
oldmenuitemNode->GetNextSibling(getter_AddRefs(menuitemNode));
} // end menu item innner loop
*/
}
}
//----------------------------------------
void nsContextMenu::LoadMenuItem(nsIContextMenu *pParentMenu,
nsIDOMElement *menuitemElement,
nsIDOMNode *menuitemNode,
unsigned short menuitemIndex,
nsIWebShell *aWebShell)
{
}
//----------------------------------------
void nsContextMenu::LoadSubMenu(nsIContextMenu *pParentMenu,
nsIDOMElement *menuElement,
nsIDOMNode *menuNode)
{
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::SetLocation(PRInt32 aX, PRInt32 aY)
{
mX = aX;
mY = aY;
return NS_OK;
}
// local methods
gint nsContextMenu::GetX(void)
{
return mX;
}
gint nsContextMenu::GetY(void)
{
return mY;
}
// end silly local methods
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::SetDOMNode(nsIDOMNode *aMenuNode)
{
mDOMNode = aMenuNode;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::SetDOMElement(nsIDOMElement *aMenuElement)
{
mDOMElement = aMenuElement;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsContextMenu::SetWebShell(nsIWebShell *aWebShell)
{
mWebShell = aWebShell;
return NS_OK;
}

View File

@@ -0,0 +1,139 @@
/* -*- 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 nsContextMenu_h__
#define nsContextMenu_h__
#include "nsIContextMenu.h"
#include "nsISupportsArray.h"
#include "nsVoidArray.h"
#include "nsIDOMElement.h"
#include "nsIWebShell.h"
class nsIMenuListener;
/**
* Native Win32 button wrapper
*/
class nsContextMenu : public nsIContextMenu, public nsIMenuListener
{
public:
nsContextMenu();
virtual ~nsContextMenu();
NS_DECL_ISUPPORTS
//nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
// nsIMenu Methods
NS_IMETHOD Create(nsISupports * aParent,
const nsString& anAlignment,
const nsString& aAnchorAlign);
NS_IMETHOD GetParent(nsISupports *&aParent);
NS_IMETHOD AddItem(nsISupports * aItem);
NS_IMETHOD AddSeparator();
NS_IMETHOD GetItemCount(PRUint32 &aCount);
NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem);
NS_IMETHOD RemoveItem(const PRUint32 aPos);
NS_IMETHOD RemoveAll();
NS_IMETHOD GetNativeData(void** aData);
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener);
//
NS_IMETHOD AddMenuItem(nsIMenuItem * aMenuItem);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD InsertSeparator(const PRUint32 aCount);
NS_IMETHOD SetDOMNode(nsIDOMNode * menuNode);
NS_IMETHOD SetDOMElement(nsIDOMElement * menuElement);
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell);
NS_IMETHOD SetLocation(PRInt32 aX, PRInt32 aY);
gint GetX(void);
gint GetY(void);
protected:
nsIMenuBar * GetMenuBar(nsIMenu * aMenu);
nsIWidget * GetParentWidget();
char* GetACPString(nsString& aStr);
void LoadMenuItem(nsIMenu * pParentMenu,
nsIDOMElement * menuitemElement,
nsIDOMNode * menuitemNode,
unsigned short menuitemIndex,
nsIWebShell * aWebShell);
void LoadSubMenu(nsIMenu * pParentMenu,
nsIDOMElement * menuElement,
nsIDOMNode * menuNode);
void LoadMenuItem(nsIContextMenu * pParentMenu,
nsIDOMElement * menuitemElement,
nsIDOMNode * menuitemNode,
unsigned short menuitemIndex,
nsIWebShell * aWebShell);
void LoadSubMenu(nsIContextMenu * pParentMenu,
nsIDOMElement * menuElement,
nsIDOMNode * menuNode);
nsIMenuItem * FindMenuItem(nsIContextMenu * aMenu, PRUint32 aId);
nsString mLabel;
PRUint32 mNumMenuItems;
GtkWidget *mMenu;
nsVoidArray mMenuItemVoidArray;
nsIWidget *mParent;
nsIMenuListener * mListener;
PRBool mConstructCalled;
nsIDOMNode * mDOMNode;
nsIWebShell * mWebShell;
nsIDOMElement * mDOMElement;
nsString mAlignment;
nsString mAnchorAlignment;
PRInt32 mX;
PRInt32 mY;
};
#endif // nsContextMenu_h__

View File

@@ -0,0 +1,592 @@
/* -*- 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 "nsDragService.h"
#include "nsITransferable.h"
#include "nsString.h"
#include "nsClipboard.h"
#include "nsIRegion.h"
#include "nsVoidArray.h"
#include "nsISupportsPrimitives.h"
#include "nsPrimitiveHelpers.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsWidgetsCID.h"
NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService)
NS_IMPL_RELEASE_INHERITED(nsDragService, nsBaseDragService)
NS_IMPL_QUERY_INTERFACE2(nsDragService, nsIDragService, nsIDragSession)
#define DEBUG_DRAG 1
//-------------------------------------------------------------------------
//
// DragService constructor
//
//-------------------------------------------------------------------------
nsDragService::nsDragService()
{
NS_INIT_REFCNT();
mWidget = nsnull;
mNumFlavors = 0;
}
//-------------------------------------------------------------------------
//
// DragService destructor
//
//-------------------------------------------------------------------------
nsDragService::~nsDragService()
{
}
enum {
TARGET_STRING,
TARGET_ROOTWIN
};
static GtkTargetEntry target_table[] = {
{ "STRING", 0, TARGET_STRING },
{ "text/plain", 0, TARGET_STRING },
{ "application/x-rootwin-drop", 0, TARGET_ROOTWIN }
};
static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
NS_IMETHODIMP nsDragService::StartDragSession()
{
printf("nsDragService::StartDragSession()\n");
nsBaseDragService::StartDragSession();
/*
gtk_drag_source_set(mWidget,
GDK_MODIFIER_MASK,
targetlist,
mNumFlavors,
action);
*/
gtk_drag_source_set(mWidget,
GDK_MODIFIER_MASK,
target_table,
n_targets,
mActionType);
return NS_OK;
}
NS_IMETHODIMP nsDragService::EndDragSession()
{
printf("nsDragService::EndDragSession()\n");
nsBaseDragService::EndDragSession();
gtk_drag_source_unset(mWidget);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::InvokeDragSession (nsISupportsArray *aTransferableArray,
nsIScriptableRegion *aRegion,
PRUint32 aActionType)
{
mWidget = gtk_get_event_widget(gtk_get_current_event());
// add the flavors from the transferables. Cache this array for the send data proc
GtkTargetList *targetlist = RegisterDragItemsAndFlavors(aTransferableArray);
switch (aActionType)
{
case DRAGDROP_ACTION_NONE:
mActionType = GDK_ACTION_DEFAULT;
break;
case DRAGDROP_ACTION_COPY:
mActionType = GDK_ACTION_COPY;
break;
case DRAGDROP_ACTION_MOVE:
mActionType = GDK_ACTION_MOVE;
break;
case DRAGDROP_ACTION_LINK:
mActionType = GDK_ACTION_LINK;
break;
}
StartDragSession();
// XXX 3rd param ??? & last param should be a real event...
gtk_drag_begin(mWidget, targetlist, mActionType, 1, gtk_get_current_event());
#if 0
// we have to synthesize the native event because we may be called from JavaScript
// through XPConnect. In that case, we only have a DOM event and no way to
// get to the native event. As a consequence, we just always fake it.
Point globalMouseLoc;
::GetMouse(&globalMouseLoc);
::LocalToGlobal(&globalMouseLoc);
WindowPtr theWindow = nsnull;
if ( ::FindWindow(globalMouseLoc, &theWindow) != inContent ) {
// debugging sanity check
#ifdef NS_DEBUG
DebugStr("\pAbout to start drag, but FindWindow() != inContent; g");
#endif
}
EventRecord theEvent;
theEvent.what = mouseDown;
theEvent.message = reinterpret_cast<UInt32>(theWindow);
theEvent.when = 0;
theEvent.where = globalMouseLoc;
theEvent.modifiers = 0;
RgnHandle theDragRgn = ::NewRgn();
BuildDragRegion ( aDragRgn, globalMouseLoc, theDragRgn );
// register drag send proc which will call us back when asked for the actual
// flavor data (instead of placing it all into the drag manager)
::SetDragSendProc ( theDragRef, sDragSendDataUPP, this );
// start the drag. Be careful, mDragRef will be invalid AFTER this call (it is
// reset by the dragTrackingHandler).
::TrackDrag ( theDragRef, &theEvent, theDragRgn );
// clean up after ourselves
::DisposeRgn ( theDragRgn );
result = ::DisposeDrag ( theDragRef );
NS_ASSERTION ( result == noErr, "Error disposing drag" );
mDragRef = 0L;
mDataItems = nsnull;
return NS_OK;
#endif
return NS_OK;
}
GtkTargetList *
nsDragService::RegisterDragItemsAndFlavors(nsISupportsArray *inArray)
{
unsigned int numDragItems = 0;
inArray->Count(&numDragItems);
GtkTargetList *targetlist;
targetlist = gtk_target_list_new(nsnull, numDragItems);
for (unsigned int i = 0; i < numDragItems; ++i)
{
nsCOMPtr<nsISupports> genericItem;
inArray->GetElementAt (i, getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> currItem (do_QueryInterface(genericItem));
if (currItem)
{
nsCOMPtr<nsISupportsArray> flavorList;
if (NS_SUCCEEDED(currItem->FlavorsTransferableCanExport(getter_AddRefs(flavorList))))
{
flavorList->Count (&mNumFlavors);
for (PRUint32 flavorIndex = 0; flavorIndex < mNumFlavors; ++flavorIndex)
{
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt ( flavorIndex, getter_AddRefs(genericWrapper) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericWrapper) );
if ( currentFlavor )
{
nsXPIDLCString flavorStr;
currentFlavor->ToString ( getter_Copies(flavorStr) );
// register native flavors
GdkAtom atom = gdk_atom_intern(flavorStr, PR_TRUE);
gtk_target_list_add(targetlist, atom, 1, atom);
}
} // foreach flavor in item
} // if valid flavor list
} // if item is a transferable
} // foreach drag item
return targetlist;
}
/* return PR_TRUE if we have converted or PR_FALSE if we havn't and need to keep being called */
PRBool nsDragService::DoConvert(GdkAtom type)
{
#ifdef DEBUG_DRAG
g_print(" nsDragService::DoRealConvert(%li)\n {\n", type);
#endif
int e = 0;
// Set a flag saying that we're blocking waiting for the callback:
mBlocking = PR_TRUE;
//
// ask X what kind of data we can get
//
#ifdef DEBUG_DRAG
g_print(" Doing real conversion of atom type '%s'\n", gdk_atom_name(type));
#endif
gtk_selection_convert(mWidget,
GDK_SELECTION_PRIMARY,
type,
GDK_CURRENT_TIME);
// Now we need to wait until the callback comes in ...
// i is in case we get a runaway (yuck).
#ifdef DEBUG_DRAG
printf(" Waiting for the callback... mBlocking = %d\n", mBlocking);
#endif /* DEBUG_CLIPBOARD */
for (e=0; mBlocking == PR_TRUE && e < 1000; ++e)
{
gtk_main_iteration_do(PR_TRUE);
}
#ifdef DEBUG_DRAG
g_print(" }\n");
#endif
if (mSelectionData.length > 0)
return PR_TRUE;
return PR_FALSE;
}
#if 0
/**
* Called when the data from a drag comes in (recieved from gdk_selection_convert)
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
* @param aTime time the selection was requested
*/
void
nsDragService::SelectionReceivedCB (GtkWidget *aWidget,
GdkDragContext *aContext,
gint aX,
gint aY,
GtkSelectionData *aSelectionData,
guint aInfo,
guint aTime)
{
#ifdef DEBUG_DRAG
printf(" nsDragService::SelectionReceivedCB\n {\n");
#endif
nsDragService *ds =(nsDragSession *)gtk_object_get_data(GTK_OBJECT(aWidget),
"ds");
if (!cb)
{
g_print("no dragservice found.. this is bad.\n");
return;
}
ds->SelectionReceiver(aWidget, aSelectionData);
#ifdef DEBUG_DRAG
g_print(" }\n");
#endif
}
/**
* local method (called from nsClipboard::SelectionReceivedCB)
*
* @param aWidget the widget
* @param aSelectionData gtk selection stuff
*/
void
nsDragService::SelectionReceiver (GtkWidget *aWidget,
GtkSelectionData *aSD)
{
gint type;
mBlocking = PR_FALSE;
if (aSD->length < 0)
{
printf(" Error retrieving selection: length was %d\n",
aSD->length);
return;
}
switch (type)
{
case GDK_TARGET_STRING:
case TARGET_COMPOUND_TEXT:
case TARGET_TEXT_PLAIN:
case TARGET_TEXT_XIF:
case TARGET_TEXT_UNICODE:
case TARGET_TEXT_HTML:
#ifdef DEBUG_CLIPBOARD
g_print(" Copying mSelectionData pointer -- ");
#endif
mSelectionData = *aSD;
mSelectionData.data = g_new(guchar, aSD->length + 1);
#ifdef DEBUG_CLIPBOARD
g_print(" Data = %s\n Length = %i\n", aSD->data, aSD->length);
#endif
memcpy(mSelectionData.data,
aSD->data,
aSD->length);
// Null terminate in case anyone cares,
// and so we can print the string for debugging:
mSelectionData.data[aSD->length] = '\0';
mSelectionData.length = aSD->length;
return;
default:
mSelectionData = *aSD;
mSelectionData.data = g_new(guchar, aSD->length + 1);
memcpy(mSelectionData.data,
aSD->data,
aSD->length);
mSelectionData.length = aSD->length;
return;
}
}
#endif
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetNumDropItems (PRUint32 * aNumItems)
{
*aNumItems = 0;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable, PRUint32 anItem)
{
#ifdef DEBUG_DRAG
printf("nsClipboard::GetNativeClipboardData()\n");
#endif /* DEBUG_CLIPBOARD */
// make sure we have a good transferable
if (!aTransferable) {
printf(" GetData: Transferable is null!\n");
return NS_ERROR_FAILURE;
}
// get flavor list that includes all acceptable flavors (including ones obtained through
// conversion)
nsCOMPtr<nsISupportsArray> flavorList;
nsresult errCode = aTransferable->FlavorsTransferableCanImport ( getter_AddRefs(flavorList) );
if ( NS_FAILED(errCode) )
return NS_ERROR_FAILURE;
// Walk through flavors and see which flavor matches the one being pasted:
PRUint32 cnt;
flavorList->Count(&cnt);
nsCAutoString foundFlavor;
for ( PRUint32 i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> genericFlavor;
flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor (do_QueryInterface(genericFlavor));
if ( currentFlavor ) {
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
if (DoConvert(gdk_atom_intern(flavorStr, 1))) {
foundFlavor = flavorStr;
break;
}
}
}
#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.
//
#if 0
// pinkerton - we have the flavor already from above, so we don't need
// to re-derrive it.
nsString *name = new nsString((const char*)gdk_atom_name(mSelectionData.type));
int format = GetFormat(*name);
df->SetString((const char*)gdk_atom_name(sSelTypes[format]));
#endif
nsCOMPtr<nsISupports> genericDataWrapper;
nsPrimitiveHelpers::CreatePrimitiveForData ( foundFlavor, mSelectionData.data, mSelectionData.length, getter_AddRefs(genericDataWrapper) );
aTransferable->SetTransferData(foundFlavor,
genericDataWrapper,
mSelectionData.length);
//delete name;
// transferable is now copying the data, so we can free it.
// g_free(mSelectionData.data);
mSelectionData.data = nsnull;
mSelectionData.length = 0;
gtk_drag_source_unset(mWidget);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
{
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetCurrentSession (nsIDragSession **aSession)
{
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
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

@@ -0,0 +1,109 @@
/* -*- 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 nsDragService_h__
#define nsDragService_h__
#include "nsBaseDragService.h"
#include <gtk/gtk.h>
/**
* Native GTK DragService wrapper
*/
class nsDragService : public nsBaseDragService
{
public:
nsDragService();
virtual ~nsDragService();
NS_DECL_ISUPPORTS_INHERITED
// nsIDragService
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables,
nsIScriptableRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD GetCurrentSession (nsIDragSession ** aSession);
// nsIDragSession
NS_IMETHOD GetData (nsITransferable * aTransferable, PRUint32 anItem);
NS_IMETHOD GetNumDropItems (PRUint32 * aNumItems);
NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval);
NS_IMETHOD StartDragSession();
NS_IMETHOD EndDragSession();
GtkTargetList *RegisterDragItemsAndFlavors(nsISupportsArray *inArray);
protected:
PRBool DoConvert(GdkAtom type);
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);
private:
GdkDragAction mActionType;
PRUint32 mNumFlavors;
GtkWidget *mWidget;
GdkDragContext *mDragContext;
GtkSelectionData mSelectionData;
PRBool mBlocking;
};
#endif // nsDragService_h__

View File

@@ -0,0 +1,304 @@
/* -*- 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 "nsCOMPtr.h"
#include "nsIComponentManager.h"
#include "nsFilePicker.h"
NS_IMPL_ISUPPORTS1(nsFilePicker, nsIFilePicker)
//-------------------------------------------------------------------------
//
// nsFilePicker constructor
//
//-------------------------------------------------------------------------
nsFilePicker::nsFilePicker()
{
NS_INIT_REFCNT();
mWidget = nsnull;
mDisplayDirectory = nsnull;
mFilterMenu = nsnull;
mOptionMenu = nsnull;
mNumberOfFilters = 0;
}
//-------------------------------------------------------------------------
//
// nsFilePicker destructor
//
//-------------------------------------------------------------------------
nsFilePicker::~nsFilePicker()
{
if (mFilterMenu)
{
GtkWidget *menu_item;
GList *list = g_list_first(GTK_MENU_SHELL(mFilterMenu)->children);
for (;list; list = list->next)
{
menu_item = GTK_WIDGET(list->data);
gchar *data = (gchar*)gtk_object_get_data(GTK_OBJECT(menu_item), "filters");
if (data)
nsCRT::free(data);
}
}
gtk_widget_destroy(mWidget);
}
static void file_ok_clicked(GtkWidget *w, PRBool *ret)
{
g_print("user hit ok\n");
*ret = PR_TRUE;
gtk_main_quit();
}
static void file_cancel_clicked(GtkWidget *w, PRBool *ret)
{
g_print("user hit cancel\n");
*ret = PR_FALSE;
gtk_main_quit();
}
static void filter_item_activated(GtkWidget *w, gpointer data)
{
// nsFilePicker *f = (nsFilePicker*)data;
gchar *foo = (gchar*)gtk_object_get_data(GTK_OBJECT(w), "filters");
g_print("filter_item_activated(): %s\n", foo);
}
//-------------------------------------------------------------------------
//
// Show - Display the file dialog
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
{
NS_ENSURE_ARG_POINTER(retval);
PRBool ret;
if (mWidget) {
// make things shorter
GtkFileSelection *fs = GTK_FILE_SELECTION(mWidget);
if (mNumberOfFilters != 0)
{
gtk_option_menu_set_menu(GTK_OPTION_MENU(mOptionMenu), mFilterMenu);
}
else
gtk_widget_hide(mOptionMenu);
#if 0
if (mDisplayDirectory)
gtk_file_selection_complete(fs, "/");
#endif
// gtk_window_set_modal(GTK_WINDOW(mWidget), PR_TRUE);
gtk_widget_show(mWidget);
// handle close, destroy, etc on the dialog
gtk_signal_connect(GTK_OBJECT(fs->ok_button), "clicked",
GTK_SIGNAL_FUNC(file_ok_clicked),
&ret);
gtk_signal_connect(GTK_OBJECT(fs->cancel_button), "clicked",
GTK_SIGNAL_FUNC(file_cancel_clicked),
&ret);
// start new loop. ret is set in the above callbacks.
gtk_main();
}
else {
ret = PR_FALSE;
}
if (ret)
*retval = returnOK;
else
*retval = returnCancel;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the list of filters
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::SetFilterList(PRInt32 aNumberOfFilters,
const PRUnichar **aTitles,
const PRUnichar **filters)
{
#if 0
GtkWidget *menu_item;
mNumberOfFilters = aNumberOfFilters;
mTitles = aTitles;
mFilters = aFilters;
mFilterMenu = gtk_menu_new();
for(unsigned int i=0; i < aNumberOfFilters; i++)
{
// we need *.{htm, html, xul, etc}
char *foo = aTitles[i].ToNewCString();
char *filters = aFilters[i].ToNewCString();
printf("%20s %s\n", foo, filters);
menu_item = gtk_menu_item_new_with_label(nsAutoCString(aTitles[i]));
gtk_object_set_data(GTK_OBJECT(menu_item), "filters", filters);
gtk_signal_connect(GTK_OBJECT(menu_item),
"activate",
GTK_SIGNAL_FUNC(filter_item_activated),
this);
gtk_menu_append(GTK_MENU(mFilterMenu), menu_item);
gtk_widget_show(menu_item);
nsCRT::free(foo);
}
#endif
return NS_OK;
}
NS_IMETHODIMP nsFilePicker::GetFile(nsIFileSpec **aFile)
{
NS_ENSURE_ARG_POINTER(*aFile);
if (mWidget) {
gchar *fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION(mWidget));
nsCOMPtr<nsIFileSpec> fileSpec(do_CreateInstance("component://netscape/filespec"));
NS_ENSURE_TRUE(fileSpec, NS_ERROR_FAILURE);
fileSpec->SetNativePath(fn);
*aFile = fileSpec;
NS_ADDREF(*aFile);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::GetSelectedFilter(PRInt32 *aType)
{
NS_ENSURE_ARG_POINTER(aType);
*aType = mSelectedType;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the file + path
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::SetDefaultString(const PRUnichar *aString)
{
if (mWidget) {
gtk_file_selection_set_filename(GTK_FILE_SELECTION(mWidget),
(const gchar*)nsAutoCString(aString));
}
return NS_OK;
}
NS_IMETHODIMP nsFilePicker::GetDefaultString(PRUnichar **aString)
{
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
//
// Set the display directory
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::SetDisplayDirectory(nsIFileSpec *aDirectory)
{
mDisplayDirectory = aDirectory;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the display directory
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::GetDisplayDirectory(nsIFileSpec **aDirectory)
{
*aDirectory = mDisplayDirectory;
NS_IF_ADDREF(*aDirectory);
return NS_OK;
}
NS_IMETHODIMP nsFilePicker::Create(nsIDOMWindow *aParent,
const PRUnichar *aTitle,
PRInt16 aMode)
{
return nsBaseFilePicker::Create(aParent, aTitle, aMode);
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFilePicker::CreateNative(nsIWidget *aParent,
const PRUnichar *aTitle,
PRInt16 aMode)
{
mWidget = gtk_file_selection_new((const gchar *)nsAutoCString(aTitle));
gtk_signal_connect(GTK_OBJECT(mWidget),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
gtk_button_box_set_layout(GTK_BUTTON_BOX(GTK_FILE_SELECTION(mWidget)->button_area), GTK_BUTTONBOX_SPREAD);
mOptionMenu = gtk_option_menu_new();
gtk_box_pack_start(GTK_BOX(GTK_FILE_SELECTION(mWidget)->main_vbox), mOptionMenu, PR_FALSE, PR_FALSE, 0);
gtk_widget_show(mOptionMenu);
// Hide the file column for the folder case.
if (aMode == nsIFilePicker::modeGetFolder) {
gtk_widget_hide((GTK_FILE_SELECTION(mWidget)->file_list)->parent);
}
return NS_OK;
}
gint
nsFilePicker::DestroySignal(GtkWidget * aGtkWidget,
nsFilePicker* aWidget)
{
aWidget->OnDestroySignal(aGtkWidget);
return TRUE;
}
void
nsFilePicker::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mWidget) {
mWidget = nsnull;
}
}

View File

@@ -0,0 +1,68 @@
/* -*- 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>
*/
#ifndef nsFilePicker_h__
#define nsFilePicker_h__
#include "nsBaseFilePicker.h"
#include <gtk/gtk.h>
/**
* Native GTK FileSelector wrapper
*/
class nsFilePicker : public nsBaseFilePicker
{
public:
nsFilePicker();
virtual ~nsFilePicker();
NS_DECL_ISUPPORTS
NS_DECL_NSIFILEPICKER
protected:
/* method from nsBaseFilePicker */
NS_IMETHOD CreateNative(nsIWidget *aParent,
const PRUnichar *aTitle,
PRInt16 aMode);
static gint DestroySignal(GtkWidget * aGtkWidget,
nsFilePicker* aWidget);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
GtkWidget *mWidget;
GtkWidget *mOptionMenu;
GtkWidget *mFilterMenu;
PRUint32 mNumberOfFilters;
const nsString* mTitles;
const nsString* mFilters;
nsString mDefault;
nsIFileSpec *mDisplayDirectory;
PRInt16 mSelectedType;
};
#endif // nsFilePicker_h__

View File

@@ -0,0 +1,322 @@
/* -*- 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):
*/
#include "nsFileWidget.h"
#include "nsIToolkit.h"
NS_IMPL_ISUPPORTS1(nsFileWidget, nsIFileWidget)
//-------------------------------------------------------------------------
//
// nsFileWidget constructor
//
//-------------------------------------------------------------------------
nsFileWidget::nsFileWidget() : nsIFileWidget()
{
NS_INIT_REFCNT();
mWidget = nsnull;
mDisplayDirectory = nsnull;
mFilterMenu = nsnull;
mOptionMenu = nsnull;
mNumberOfFilters = 0;
}
//-------------------------------------------------------------------------
//
// nsFileWidget destructor
//
//-------------------------------------------------------------------------
nsFileWidget::~nsFileWidget()
{
if (mFilterMenu)
{
GtkWidget *menu_item;
GList *list = g_list_first(GTK_MENU_SHELL(mFilterMenu)->children);
for (;list; list = list->next)
{
menu_item = GTK_WIDGET(list->data);
gchar *data = (gchar*)gtk_object_get_data(GTK_OBJECT(menu_item), "filters");
if (data)
nsCRT::free(data);
}
}
gtk_widget_destroy(mWidget);
}
static void file_ok_clicked(GtkWidget *w, PRBool *ret)
{
g_print("user hit ok\n");
*ret = PR_TRUE;
gtk_main_quit();
}
static void file_cancel_clicked(GtkWidget *w, PRBool *ret)
{
g_print("user hit cancel\n");
*ret = PR_FALSE;
gtk_main_quit();
}
static void filter_item_activated(GtkWidget *w, gpointer data)
{
// nsFileWidget *f = (nsFileWidget*)data;
gchar *foo = (gchar*)gtk_object_get_data(GTK_OBJECT(w), "filters");
g_print("filter_item_activated(): %s\n", foo);
}
//-------------------------------------------------------------------------
//
// Show - Display the file dialog
//
//-------------------------------------------------------------------------
PRBool nsFileWidget::Show()
{
PRBool ret;
if (mWidget) {
// make things shorter
GtkFileSelection *fs = GTK_FILE_SELECTION(mWidget);
if (mNumberOfFilters != 0)
{
gtk_option_menu_set_menu(GTK_OPTION_MENU(mOptionMenu), mFilterMenu);
}
else
gtk_widget_hide(mOptionMenu);
#if 0
if (mDisplayDirectory)
gtk_file_selection_complete(fs, "/");
#endif
// gtk_window_set_modal(GTK_WINDOW(mWidget), PR_TRUE);
gtk_widget_show(mWidget);
// handle close, destroy, etc on the dialog
gtk_signal_connect(GTK_OBJECT(fs->ok_button), "clicked",
GTK_SIGNAL_FUNC(file_ok_clicked),
&ret);
gtk_signal_connect(GTK_OBJECT(fs->cancel_button), "clicked",
GTK_SIGNAL_FUNC(file_cancel_clicked),
&ret);
// start new loop. ret is set in the above callbacks.
gtk_main();
}
else {
ret = PR_FALSE;
}
return ret;
}
//-------------------------------------------------------------------------
//
// Set the list of filters
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,
const nsString aTitles[],
const nsString aFilters[])
{
GtkWidget *menu_item;
mNumberOfFilters = aNumberOfFilters;
mTitles = aTitles;
mFilters = aFilters;
mFilterMenu = gtk_menu_new();
for(unsigned int i=0; i < aNumberOfFilters; i++)
{
// we need *.{htm, html, xul, etc}
char *foo = aTitles[i].ToNewCString();
char *filters = aFilters[i].ToNewCString();
printf("%20s %s\n", foo, filters);
menu_item = gtk_menu_item_new_with_label(nsAutoCString(aTitles[i]));
gtk_object_set_data(GTK_OBJECT(menu_item), "filters", filters);
gtk_signal_connect(GTK_OBJECT(menu_item),
"activate",
GTK_SIGNAL_FUNC(filter_item_activated),
this);
gtk_menu_append(GTK_MENU(mFilterMenu), menu_item);
gtk_widget_show(menu_item);
nsCRT::free(foo);
}
return NS_OK;
}
NS_IMETHODIMP nsFileWidget::GetFile(nsFileSpec& aFile)
{
if (mWidget) {
gchar *fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION(mWidget));
aFile = fn; // Put the filename into the nsFileSpec instance.
}
return NS_OK;
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::GetSelectedType(PRInt16& theType)
{
theType = mSelectedType;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the file + path
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::SetDefaultString(const nsString& aString)
{
if (mWidget) {
gtk_file_selection_set_filename(GTK_FILE_SELECTION(mWidget),
(const gchar*)nsAutoCString(aString));
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the display directory
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::SetDisplayDirectory(const nsFileSpec& aDirectory)
{
mDisplayDirectory = aDirectory;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the display directory
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::GetDisplayDirectory(nsFileSpec& aDirectory)
{
aDirectory = mDisplayDirectory;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsFileWidget::Create(nsIWidget *aParent,
const nsString& aTitle,
nsFileDlgMode aMode,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit,
void *aInitData)
{
mMode = aMode;
mTitle.SetLength(0);
mTitle.Append(aTitle);
mWidget = gtk_file_selection_new((const gchar *)nsAutoCString(aTitle));
gtk_signal_connect(GTK_OBJECT(mWidget),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
gtk_button_box_set_layout(GTK_BUTTON_BOX(GTK_FILE_SELECTION(mWidget)->button_area), GTK_BUTTONBOX_SPREAD);
mOptionMenu = gtk_option_menu_new();
gtk_box_pack_start(GTK_BOX(GTK_FILE_SELECTION(mWidget)->main_vbox), mOptionMenu, PR_FALSE, PR_FALSE, 0);
gtk_widget_show(mOptionMenu);
// Hide the file column for the folder case.
if (aMode == eMode_getfolder) {
gtk_widget_hide((GTK_FILE_SELECTION(mWidget)->file_list)->parent);
}
return NS_OK;
}
gint
nsFileWidget::DestroySignal(GtkWidget * aGtkWidget,
nsFileWidget* aWidget)
{
aWidget->OnDestroySignal(aGtkWidget);
return TRUE;
}
void
nsFileWidget::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mWidget) {
mWidget = nsnull;
}
}
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;
}

View File

@@ -0,0 +1,102 @@
/* -*- 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):
*/
#ifndef nsFileWidget_h__
#define nsFileWidget_h__
#include "nsIWidget.h"
#include "nsIFileWidget.h"
#include <gtk/gtk.h>
class nsIToolkit;
/**
* Native GTK FileSelector wrapper
*/
class nsFileWidget : public nsIFileWidget
{
public:
nsFileWidget();
virtual ~nsFileWidget();
NS_DECL_ISUPPORTS
// 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:
static gint DestroySignal(GtkWidget * aGtkWidget,
nsFileWidget* aWidget);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
GtkWidget *mWidget;
nsString mTitle;
GtkWidget *mOptionMenu;
GtkWidget *mFilterMenu;
nsFileDlgMode mMode;
PRUint32 mNumberOfFilters;
const nsString* mTitles;
const nsString* mFilters;
nsString mDefault;
nsFileSpec mDisplayDirectory;
PRInt16 mSelectedType;
};
#endif // nsFileWidget_h__

View File

@@ -0,0 +1,395 @@
/* -*- 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 "nsFontRetrieverService.h"
#include "nsIWidget.h"
#include <ctype.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "X11/Xlib.h"
#include "X11/Xutil.h"
#include "nsFont.h"
#include "nsVoidArray.h"
#include "nsFontSizeIterator.h"
NS_IMPL_ISUPPORTS2(nsFontRetrieverService, nsIFontRetrieverService, nsIFontNameIterator)
//----------------------------------------------------------
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);
}
//----------------------------------------------------------
//-- 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

@@ -0,0 +1,65 @@
/* -*- 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 __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

@@ -0,0 +1,88 @@
/* -*- 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):
*/
#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

@@ -0,0 +1,59 @@
/* -*- 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 __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

@@ -0,0 +1,967 @@
/* -*- 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 "nsWidget.h"
#include "nsWindow.h"
#include "nsScrollbar.h"
#include "nsIFileWidget.h"
#include "nsGUIEvent.h"
#include "nsIMenu.h"
#include "nsIMenuItem.h"
#include "nsIMenuListener.h"
#include "nsTextWidget.h"
#include "nsICharsetConverterManager.h"
#include "nsIPlatformCharset.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
#include "stdio.h"
#include "ctype.h"
#include "gtk/gtk.h"
#include "nsGtkEventHandler.h"
#include <gdk/gdkkeysyms.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef DEBUG_pavlov
//#define DEBUG_EVENTS 1
#endif
struct EventInfo {
nsWidget *widget; // the widget
nsRect *rect; // the rect
};
//==============================================================
void InitAllocationEvent(GtkAllocation *aAlloc,
gpointer p,
nsSizeEvent &anEvent,
PRUint32 aEventType)
{
anEvent.message = aEventType;
anEvent.widget = (nsWidget *) p;
anEvent.eventStructType = NS_SIZE_EVENT;
if (aAlloc != nsnull) {
// HACK
// nsRect *foo = new nsRect(aAlloc->x, aAlloc->y, aAlloc->width, aAlloc->height);
nsRect *foo = new nsRect(0, 0, aAlloc->width, aAlloc->height);
anEvent.windowSize = foo;
// anEvent.point.x = aAlloc->x;
// anEvent.point.y = aAlloc->y;
// HACK
anEvent.point.x = 0;
anEvent.point.y = 0;
anEvent.mWinWidth = aAlloc->width;
anEvent.mWinHeight = aAlloc->height;
}
anEvent.time = PR_IntervalNow();
}
//==============================================================
void InitConfigureEvent(GdkEventConfigure *aConf,
gpointer p,
nsSizeEvent &anEvent,
PRUint32 aEventType)
{
anEvent.message = aEventType;
anEvent.widget = (nsWidget *) p;
anEvent.eventStructType = NS_SIZE_EVENT;
if (aConf != nsnull) {
/* do we accually need to alloc a new rect, or can we just set the
current one */
nsRect *foo = new nsRect(aConf->x, aConf->y, aConf->width, aConf->height);
anEvent.windowSize = foo;
anEvent.point.x = aConf->x;
anEvent.point.y = aConf->y;
anEvent.mWinWidth = aConf->width;
anEvent.mWinHeight = aConf->height;
}
// this usually returns 0
anEvent.time = 0;
}
//==============================================================
void InitExposeEvent(GdkEventExpose *aGEE,
gpointer p,
nsPaintEvent &anEvent,
PRUint32 aEventType)
{
anEvent.message = aEventType;
anEvent.widget = (nsWidget *) p;
anEvent.eventStructType = NS_PAINT_EVENT;
if (aGEE != nsnull)
{
#ifdef DEBUG_EVENTS
g_print("expose event: x = %i , y = %i , w = %i , h = %i\n",
aGEE->area.x, aGEE->area.y,
aGEE->area.width, aGEE->area.height);
#endif
anEvent.point.x = aGEE->area.x;
anEvent.point.y = aGEE->area.y;
nsRect *rect = new nsRect(aGEE->area.x, aGEE->area.y,
aGEE->area.width, aGEE->area.height);
anEvent.rect = rect;
anEvent.time = gdk_event_get_time((GdkEvent*)aGEE);
}
}
//=============================================================
void UninitExposeEvent(GdkEventExpose *aGEE,
gpointer p,
nsPaintEvent &anEvent,
PRUint32 aEventType)
{
if (aGEE != nsnull) {
delete anEvent.rect;
}
}
struct nsKeyConverter {
int vkCode; // Platform independent key code
int keysym; // GDK keysym key code
};
//
// Netscape keycodes are defined in widget/public/nsGUIEvent.h
// GTK keycodes are defined in <gdk/gdkkeysyms.h>
//
struct nsKeyConverter nsKeycodes[] = {
{ NS_VK_CANCEL, GDK_Cancel },
{ NS_VK_BACK, GDK_BackSpace },
{ NS_VK_TAB, GDK_Tab },
{ NS_VK_TAB, GDK_ISO_Left_Tab },
{ NS_VK_CLEAR, GDK_Clear },
{ NS_VK_RETURN, GDK_Return },
{ NS_VK_SHIFT, GDK_Shift_L },
{ NS_VK_SHIFT, GDK_Shift_R },
{ NS_VK_CONTROL, GDK_Control_L },
{ NS_VK_CONTROL, GDK_Control_R },
{ NS_VK_ALT, GDK_Alt_L },
{ NS_VK_ALT, GDK_Alt_R },
{ NS_VK_PAUSE, GDK_Pause },
{ NS_VK_CAPS_LOCK, GDK_Caps_Lock },
{ NS_VK_ESCAPE, GDK_Escape },
{ NS_VK_SPACE, GDK_space },
{ NS_VK_PAGE_UP, GDK_Page_Up },
{ NS_VK_PAGE_DOWN, GDK_Page_Down },
{ NS_VK_END, GDK_End },
{ NS_VK_HOME, GDK_Home },
{ NS_VK_LEFT, GDK_Left },
{ NS_VK_UP, GDK_Up },
{ NS_VK_RIGHT, GDK_Right },
{ NS_VK_DOWN, GDK_Down },
{ NS_VK_PRINTSCREEN, GDK_Print },
{ NS_VK_INSERT, GDK_Insert },
{ NS_VK_DELETE, GDK_Delete },
{ NS_VK_MULTIPLY, GDK_KP_Multiply },
{ NS_VK_ADD, GDK_KP_Add },
{ NS_VK_SEPARATOR, GDK_KP_Separator },
{ NS_VK_SUBTRACT, GDK_KP_Subtract },
{ NS_VK_DECIMAL, GDK_KP_Decimal },
{ NS_VK_DIVIDE, GDK_KP_Divide },
{ NS_VK_RETURN, GDK_KP_Enter },
// NS doesn't have dash or equals distinct from the numeric keypad ones,
// so we'll use those for now. See bug 17008:
{ NS_VK_SUBTRACT, GDK_minus },
{ NS_VK_EQUALS, GDK_equal },
// and we don't have a single-quote symbol either:
{ NS_VK_QUOTE, GDK_apostrophe },
{ NS_VK_COMMA, GDK_comma },
{ NS_VK_PERIOD, GDK_period },
{ NS_VK_SLASH, GDK_slash },
{ NS_VK_BACK_SLASH, GDK_backslash },
{ NS_VK_BACK_QUOTE, GDK_grave },
{ NS_VK_OPEN_BRACKET, GDK_bracketleft },
{ NS_VK_CLOSE_BRACKET, GDK_bracketright },
{ NS_VK_QUOTE, GDK_quotedbl },
// Some shifted keys, see bug 15463.
// These should be subject to different keyboard mappings;
// how do we do that in gtk?
{ NS_VK_SEMICOLON, GDK_colon },
{ NS_VK_BACK_QUOTE, GDK_asciitilde },
{ NS_VK_COMMA, GDK_less },
{ NS_VK_PERIOD, GDK_greater },
{ NS_VK_SLASH, GDK_question },
{ NS_VK_1, GDK_exclam },
{ NS_VK_2, GDK_at },
{ NS_VK_3, GDK_numbersign },
{ NS_VK_4, GDK_dollar },
{ NS_VK_5, GDK_percent },
{ NS_VK_6, GDK_asciicircum },
{ NS_VK_7, GDK_ampersand },
{ NS_VK_8, GDK_asterisk },
{ NS_VK_9, GDK_parenleft },
{ NS_VK_0, GDK_parenright },
{ NS_VK_SUBTRACT, GDK_underscore },
{ NS_VK_EQUALS, GDK_plus }
};
void nsGtkWidget_InitNSKeyEvent(int aEventType, nsKeyEvent& aKeyEvent,
GtkWidget *w, gpointer p, GdkEventKey * event);
//==============================================================
// Input keysym is in gtk format; output is in NS_VK format
int nsPlatformToDOMKeyCode(GdkEventKey *aGEK)
{
int i;
int length = sizeof(nsKeycodes) / sizeof(struct nsKeyConverter);
int keysym = aGEK->keyval;
// First, try to handle alphanumeric input, not listed in nsKeycodes:
// most likely, more letters will be getting typed in than things in
// the key list, so we will look through these first.
// since X has different key symbols for upper and lowercase letters and
// mozilla does not, convert gdk's to mozilla's
if (keysym >= GDK_a && keysym <= GDK_z)
return keysym - GDK_a + NS_VK_A;
if (keysym >= GDK_A && keysym <= GDK_Z)
return keysym - GDK_A + NS_VK_A;
// numbers
if (keysym >= GDK_0 && keysym <= GDK_9)
return keysym - GDK_0 + NS_VK_0;
// keypad numbers
if (keysym >= GDK_KP_0 && keysym <= GDK_KP_9)
return keysym - GDK_KP_0 + NS_VK_NUMPAD0;
// misc other things
for (i = 0; i < length; i++) {
if (nsKeycodes[i].keysym == keysym)
return(nsKeycodes[i].vkCode);
}
// function keys
if (keysym >= GDK_F1 && keysym <= GDK_F24)
return keysym - GDK_F1 + NS_VK_F1;
#if defined(DEBUG_akkana) || defined(DEBUG_ftang)
printf("No match in nsPlatformToDOMKeyCode: keysym is 0x%x, string is %s\n", keysym, aGEK->string);
#endif
return((int)0);
}
//==============================================================
PRUint32 nsConvertCharCodeToUnicode(GdkEventKey* aGEK)
{
// For control chars, GDK sets string to be the actual ascii value.
// Map that to what nsKeyEvent wants, which currently --
// TEMPORARILY (the spec has changed and will be switched over
// when the tree opens for M11) --
// is the ascii for the actual event (e.g. 1 for control-a).
// This is only true for control chars; for alt chars, send the
// ascii for the key, i.e. a for alt-a.
if (aGEK->state & GDK_CONTROL_MASK)
{
if (aGEK->state & GDK_SHIFT_MASK)
return aGEK->string[0] + 'A' - 1;
else
return aGEK->string[0] + 'a' - 1;
}
// For now (obviously this will need to change for IME),
// only set a char code if the result is printable:
if (!isprint(aGEK->string[0]))
return 0;
// ALT keys in gdk give the upper case character in string,
// but we want the lower case char in char code
// unless shift was also pressed.
if (((aGEK->state & GDK_MOD1_MASK))
&& !(aGEK->state & GDK_SHIFT_MASK)
&& isupper(aGEK->string[0]))
return tolower(aGEK->string[0]);
//
// placeholder for something a little more interesting and correct
//
return aGEK->string[0];
}
//==============================================================
void InitKeyEvent(GdkEventKey *aGEK,
gpointer p,
nsKeyEvent &anEvent,
PRUint32 aEventType)
{
anEvent.message = aEventType;
anEvent.widget = (nsWidget *) p;
anEvent.eventStructType = NS_KEY_EVENT;
if (aGEK != nsnull) {
anEvent.keyCode = nsPlatformToDOMKeyCode(aGEK);
anEvent.charCode = 0;
anEvent.time = aGEK->time;
anEvent.isShift = (aGEK->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;
anEvent.isControl = (aGEK->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;
anEvent.isAlt = (aGEK->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;
// XXX
anEvent.isMeta = PR_FALSE; //(aGEK->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;
anEvent.point.x = 0;
anEvent.point.y = 0;
}
}
void InitKeyPressEvent(GdkEventKey *aGEK,
gpointer p,
nsKeyEvent &anEvent)
{
//
// init the basic event fields
//
anEvent.eventStructType = NS_KEY_EVENT;
anEvent.message = NS_KEY_PRESS;
anEvent.widget = (nsWidget*)p;
if (aGEK!=nsnull)
{
anEvent.isShift = (aGEK->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;
anEvent.isControl = (aGEK->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;
anEvent.isAlt = (aGEK->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;
// XXX
anEvent.isMeta = PR_FALSE; //(aGEK->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;
if(aGEK->length)
anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);
else
anEvent.charCode = 0;
if (anEvent.charCode) {
anEvent.keyCode = 0;
anEvent.isShift = PR_FALSE;
} else
anEvent.keyCode = nsPlatformToDOMKeyCode(aGEK);
#if defined(DEBUG_akkana) || defined(DEBUG_pavlov) || defined (DEBUG_ftang)
printf("Key Press event: keyCode = 0x%x, char code = '%c'",
anEvent.keyCode, anEvent.charCode);
if (anEvent.isShift)
printf(" [shift]");
if (anEvent.isControl)
printf(" [ctrl]");
if (anEvent.isAlt)
printf(" [alt]");
if (anEvent.isMeta)
printf(" [meta]");
printf("\n");
#endif
anEvent.time = aGEK->time;
anEvent.point.x = 0;
anEvent.point.y = 0;
}
}
//=============================================================
void UninitKeyEvent(GdkEventKey *aGEK,
gpointer p,
nsKeyEvent &anEvent,
PRUint32 aEventType)
{
}
/*==============================================================
==============================================================
=============================================================
==============================================================*/
void handle_size_allocate(GtkWidget *w, GtkAllocation *alloc, gpointer p)
{
nsWindow *widget = (nsWindow *)p;
nsSizeEvent event;
InitAllocationEvent(alloc, p, event, NS_SIZE);
NS_ADDREF(widget);
widget->OnResize(event);
NS_RELEASE(widget);
delete event.windowSize;
}
gint handle_expose_event(GtkWidget *w, GdkEventExpose *event, gpointer p)
{
if (event->type == GDK_NO_EXPOSE)
return PR_FALSE;
nsPaintEvent pevent;
InitExposeEvent(event, p, pevent, NS_PAINT);
nsWindow *win = (nsWindow *)p;
win->AddRef();
win->OnExpose(pevent);
win->Release();
UninitExposeEvent(event, p, pevent, NS_PAINT);
return PR_TRUE;
}
//==============================================================
void menu_item_activate_handler(GtkWidget *w, gpointer p)
{
// g_print("menu_item_activate_handler\n");
nsIMenuListener *menuListener = nsnull;
nsIMenuItem *menuItem = (nsIMenuItem *)p;
if (menuItem != nsnull) {
nsMenuEvent mevent;
mevent.message = NS_MENU_SELECTED;
mevent.eventStructType = NS_MENU_EVENT;
mevent.point.x = 0;
mevent.point.y = 0;
// mevent.widget = menuItem;
mevent.widget = nsnull;
menuItem->GetCommand(mevent.mCommand);
mevent.mMenuItem = menuItem;
mevent.time = PR_IntervalNow();
// FIXME - THIS SHOULD WORK. FIX EVENTS FOR XP CODE!!!!! (pav)
// nsEventStatus status;
// mevent.widget->DispatchEvent((nsGUIEvent *)&mevent, status);
menuItem->QueryInterface(nsIMenuListener::GetIID(), (void**)&menuListener);
if(menuListener) {
menuListener->MenuItemSelected(mevent);
NS_IF_RELEASE(menuListener);
}
}
}
//==============================================================
void menu_map_handler(GtkWidget *w, gpointer p)
{
nsIMenuListener *menuListener = nsnull;
nsIMenu *menu = (nsIMenu *)p;
if (menu != nsnull) {
nsMenuEvent mevent;
mevent.message = NS_MENU_SELECTED;
mevent.eventStructType = NS_MENU_EVENT;
mevent.point.x = 0;
mevent.point.y = 0;
mevent.widget = nsnull;
mevent.time = PR_IntervalNow();
menu->QueryInterface(nsIMenuListener::GetIID(), (void**)&menuListener);
if(menuListener) {
menuListener->MenuConstruct(
mevent,
nsnull, //parent window
nsnull, //menuNode
nsnull ); // webshell
NS_IF_RELEASE(menuListener);
}
}
}
//==============================================================
void menu_unmap_handler(GtkWidget *w, gpointer p)
{
nsIMenuListener *menuListener = nsnull;
nsIMenu *menu = (nsIMenu *)p;
if (menu != nsnull) {
nsMenuEvent mevent;
mevent.message = NS_MENU_SELECTED;
mevent.eventStructType = NS_MENU_EVENT;
mevent.point.x = 0;
mevent.point.y = 0;
mevent.widget = nsnull;
mevent.time = PR_IntervalNow();
menu->QueryInterface(nsIMenuListener::GetIID(), (void**)&menuListener);
if(menuListener) {
menuListener->MenuDestruct(mevent);
NS_IF_RELEASE(menuListener);
}
}
}
//==============================================================
void handle_scrollbar_value_changed(GtkAdjustment *adj, gpointer p)
{
nsScrollbar *widget = (nsScrollbar*) p;
nsScrollbarEvent sevent;
sevent.message = NS_SCROLLBAR_POS;
sevent.widget = (nsWidget *) p;
sevent.eventStructType = NS_SCROLLBAR_EVENT;
GdkWindow *win = (GdkWindow *)widget->GetNativeData(NS_NATIVE_WINDOW);
gdk_window_get_pointer(win, &sevent.point.x, &sevent.point.y, nsnull);
widget->AddRef();
widget->OnScroll(sevent, adj->value);
widget->Release();
/* FIXME we need to set point.* from the event stuff. */
#if 0
nsWindow * widgetWindow = (nsWindow *) p ;
XmScrollBarCallbackStruct * cbs = (XmScrollBarCallbackStruct*) call_data;
sevent.widget = (nsWindow *) p;
if (cbs->event != nsnull) {
sevent.point.x = cbs->event->xbutton.x;
sevent.point.y = cbs->event->xbutton.y;
} else {
sevent.point.x = 0;
sevent.point.y = 0;
}
sevent.time = 0; //XXX Implement this
switch (cbs->reason) {
case XmCR_INCREMENT:
sevent.message = NS_SCROLLBAR_LINE_NEXT;
break;
case XmCR_DECREMENT:
sevent.message = NS_SCROLLBAR_LINE_PREV;
break;
case XmCR_PAGE_INCREMENT:
sevent.message = NS_SCROLLBAR_PAGE_NEXT;
break;
case XmCR_PAGE_DECREMENT:
sevent.message = NS_SCROLLBAR_PAGE_PREV;
break;
case XmCR_DRAG:
sevent.message = NS_SCROLLBAR_POS;
break;
case XmCR_VALUE_CHANGED:
sevent.message = NS_SCROLLBAR_POS;
break;
default:
break;
}
#endif
}
static gint composition_start(GdkEventKey *aEvent, nsWindow *aWin,
nsEventStatus *aStatus) {
nsCompositionEvent compEvent;
compEvent.widget = (nsWidget*)aWin;
compEvent.point.x = 0;
compEvent.point.y = 0;
compEvent.time = aEvent->time;
compEvent.message = NS_COMPOSITION_START;
compEvent.eventStructType = NS_COMPOSITION_START;
compEvent.compositionMessage = NS_COMPOSITION_START;
aWin->DispatchEvent(&compEvent, *aStatus);
// set SpotLocation
aWin->SetXICSpotLocation(compEvent.theReply.mCursorPosition);
return PR_TRUE;
}
static gint composition_draw(GdkEventKey *aEvent, nsWindow *aWin,
nsIUnicodeDecoder *aDecoder,
nsEventStatus *aStatus) {
if (!aWin->mIMECompositionUniString) {
aWin->mIMECompositionUniStringSize = 128;
aWin->mIMECompositionUniString =
new PRUnichar[aWin->mIMECompositionUniStringSize];
}
PRUnichar *uniChar;
PRInt32 uniCharSize;
PRInt32 srcLen = aEvent->length;
for (;;) {
uniChar = aWin->mIMECompositionUniString;
uniCharSize = aWin->mIMECompositionUniStringSize - 1;
aDecoder->Convert((char*)aEvent->string, &srcLen, uniChar, &uniCharSize);
if (srcLen == aEvent->length &&
uniCharSize < aWin->mIMECompositionUniStringSize - 1) {
break;
}
aWin->mIMECompositionUniStringSize += 32;
aWin->mIMECompositionUniString =
new PRUnichar[aWin->mIMECompositionUniStringSize];
}
aWin->mIMECompositionUniString[uniCharSize] = 0;
nsTextEvent textEvent;
textEvent.message = NS_TEXT_EVENT;
textEvent.widget = (nsWidget*)aWin;
textEvent.time = aEvent->time;
textEvent.point.x = 0;
textEvent.point.y = 0;
textEvent.theText = aWin->mIMECompositionUniString;
textEvent.rangeCount = 0;
textEvent.rangeArray = nsnull;
textEvent.isShift = (aEvent->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;
textEvent.isControl = (aEvent->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;
textEvent.isAlt = (aEvent->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;
// XXX
textEvent.isMeta = PR_FALSE; //(aEvent->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;
textEvent.eventStructType = NS_TEXT_EVENT;
aWin->DispatchEvent(&textEvent, *aStatus);
aWin->SetXICSpotLocation(textEvent.theReply.mCursorPosition);
return True;
}
static gint composition_end(GdkEventKey *aEvent, nsWindow *aWin,
nsEventStatus *aStatus) {
nsCompositionEvent compEvent;
compEvent.widget = (nsWidget*)aWin;
compEvent.point.x = 0;
compEvent.point.y = 0;
compEvent.time = aEvent->time;
compEvent.message = NS_COMPOSITION_END;
compEvent.eventStructType = NS_COMPOSITION_END;
compEvent.compositionMessage = NS_COMPOSITION_END;
aWin->DispatchEvent(&compEvent, *aStatus);
return PR_TRUE;
}
static nsIUnicodeDecoder*
open_unicode_decoder(void) {
nsresult result = NS_ERROR_FAILURE;
nsIUnicodeDecoder *decoder = nsnull;
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
&result);
if (platform && NS_SUCCEEDED(result)) {
nsAutoString charset("");
result = platform->GetCharset(kPlatformCharsetSel_Menu, charset);
if (NS_FAILED(result) || (charset.Length() == 0)) {
charset = "ISO-8859-1"; // default
}
nsICharsetConverterManager* manager = nsnull;
nsresult res = nsServiceManager::
GetService(kCharsetConverterManagerCID,
nsCOMTypeInfo<nsICharsetConverterManager>::GetIID(),
(nsISupports**)&manager);
if (manager && NS_SUCCEEDED(res)) {
manager->GetUnicodeDecoder(&charset, &decoder);
nsServiceManager::ReleaseService(kCharsetConverterManagerCID, manager);
}
}
return decoder;
}
// GTK's text widget already does XIM, so we don't want to do this again
gint handle_key_press_event_for_text(GtkObject *w, GdkEventKey* event,
gpointer p)
{
nsKeyEvent kevent;
nsTextWidget* win = (nsTextWidget*)p;
// work around for annoying things.
if (event->keyval == GDK_Tab)
if (event->state & GDK_CONTROL_MASK)
if (event->state & GDK_MOD1_MASK)
return PR_FALSE;
// Don't pass shift, control and alt as key press events
if (event->keyval == GDK_Shift_L
|| event->keyval == GDK_Shift_R
|| event->keyval == GDK_Control_L
|| event->keyval == GDK_Control_R)
return PR_TRUE;
win->AddRef();
InitKeyEvent(event, p, kevent, NS_KEY_DOWN);
win->OnKey(kevent);
//
// Second, dispatch the Key event as a key press event w/ a Unicode
// character code. Note we have to check for modifier keys, since
// gtk returns a character value for them
//
InitKeyPressEvent(event,p, kevent);
win->OnKey(kevent);
win->Release();
if (w)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_press_event");
}
return PR_TRUE;
}
// GTK's text widget already does XIM, so we don't want to do this again
gint handle_key_release_event_for_text(GtkObject *w, GdkEventKey* event,
gpointer p)
{
nsKeyEvent kevent;
nsTextWidget* win = (nsTextWidget*)p;
// Don't pass shift, control and alt as key release events
if (event->keyval == GDK_Shift_L
|| event->keyval == GDK_Shift_R
|| event->keyval == GDK_Control_L
|| event->keyval == GDK_Control_R)
return PR_TRUE;
InitKeyEvent(event, p, kevent, NS_KEY_UP);
win->AddRef();
win->OnKey(kevent);
win->Release();
if (w)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_release_event");
}
return PR_TRUE;
}
//==============================================================
gint handle_key_press_event(GtkObject *w, GdkEventKey* event, gpointer p)
{
nsKeyEvent kevent;
nsWindow* win = (nsWindow*)p;
// work around for annoying things.
if (event->keyval == GDK_Tab)
if (event->state & GDK_CONTROL_MASK)
if (event->state & GDK_MOD1_MASK)
return PR_FALSE;
// Don't pass shift, control and alt as key press events
if (event->keyval == GDK_Shift_L
|| event->keyval == GDK_Shift_R
|| event->keyval == GDK_Control_L
|| event->keyval == GDK_Control_R)
return PR_TRUE;
win->AddRef();
//
// First, dispatch the Key event as a virtual key down event
//
InitKeyEvent(event, p, kevent, NS_KEY_DOWN);
win->OnKey(kevent);
//
// Second, dispatch the Key event as a key press event w/ a Unicode
// character code. Note we have to check for modifier keys, since
// gtk returns a character value for them
//
if (event->length) {
static nsIUnicodeDecoder *decoder = nsnull;
if (!decoder) {
decoder = open_unicode_decoder();
}
if (decoder && (!kevent.keyCode)) {
nsEventStatus status;
composition_start(event, win, &status);
composition_draw(event, win, decoder, &status);
composition_end(event, win, &status);
} else {
InitKeyPressEvent(event,p, kevent);
win->OnKey(kevent);
nsEventStatus status;
composition_start(event, win, &status);
composition_end(event, win, &status);
}
} else { // for Home/End/Up/Down/Left/Right/PageUp/PageDown key
InitKeyPressEvent(event,p, kevent);
win->OnKey(kevent);
}
win->Release();
if (w)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_press_event");
}
return PR_TRUE;
}
//==============================================================
gint handle_key_release_event(GtkObject *w, GdkEventKey* event, gpointer p)
{
// Don't pass shift, control and alt as key release events
if (event->keyval == GDK_Shift_L
|| event->keyval == GDK_Shift_R
|| event->keyval == GDK_Control_L
|| event->keyval == GDK_Control_R)
return PR_TRUE;
nsKeyEvent kevent;
InitKeyEvent(event, p, kevent, NS_KEY_UP);
nsWindow * win = (nsWindow *) p;
win->AddRef();
win->OnKey(kevent);
win->Release();
if (w)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_release_event");
}
return PR_TRUE;
}
//==============================================================
void
handle_gdk_event (GdkEvent *event, gpointer data)
{
GtkObject *object = nsnull;
if (event->any.window)
gdk_window_get_user_data (event->any.window, (void **)&object);
if (object != nsnull &&
GDK_IS_SUPERWIN (object))
{
// It was an event on one of our superwindows
nsWindow *window = (nsWindow *)gtk_object_get_data (object, "nsWindow");
if (gtk_grab_get_current () != nsnull)
{
// A GTK+ grab is in effect. Rewrite the event to point to
// our toplevel, and pass it through.
// XXX: We should actually translate the coordinates
gdk_window_unref (event->any.window);
event->any.window = GTK_WIDGET (window->GetMozArea())->window;
gdk_window_ref (event->any.window);
}
else
{
// Handle it ourselves.
switch (event->type)
{
case GDK_KEY_PRESS:
handle_key_press_event (NULL, &event->key, window);
break;
case GDK_KEY_RELEASE:
handle_key_release_event (NULL, &event->key, window);
break;
default:
window->HandleEvent (event);
}
return;
}
}
gtk_main_do_event (event);
}
//==============================================================
void
handle_xlib_shell_event(GdkSuperWin *superwin, XEvent *event, gpointer p)
{
nsWindow *window = (nsWindow *)p;
switch(event->xany.type) {
case ConfigureNotify:
window->HandleXlibConfigureNotifyEvent(event);
break;
default:
break;
}
}
//==============================================================
void
handle_xlib_bin_event(GdkSuperWin *superwin, XEvent *event, gpointer p)
{
nsWindow *window = (nsWindow *)p;
switch(event->xany.type) {
case Expose:
window->HandleXlibExposeEvent(event);
break;
case ButtonPress:
case ButtonRelease:
window->HandleXlibButtonEvent((XButtonEvent *)event);
break;
case MotionNotify:
window->HandleXlibMotionNotifyEvent((XMotionEvent *) event);
break;
case EnterNotify:
case LeaveNotify:
window->HandleXlibCrossingEvent((XCrossingEvent *) event);
break;
default:
break;
}
}
//==============================================================
gint nsGtkWidget_FSBCancel_Callback(GtkWidget *w, gpointer p)
{
#if 0
nsWindow *widgetWindow = (nsWindow*)gtk_object_get_user_data(GTK_OBJECT(w));
nsFileWidget * widgetWindow = (nsFileWidget *) p ;
if (p != nsnull) {
widgetWindow->OnCancel();
}
#endif
return PR_FALSE;
}
//==============================================================
gint nsGtkWidget_FSBOk_Callback(GtkWidget *w, gpointer p)
{
#if 0
nsWindow *widgetWindow = (nsWindow*)gtk_object_get_user_data(GTK_OBJECT(w));
nsFileWidget * widgetWindow = (nsFileWidget *) p;
if (p != nsnull) {
widgetWindow->OnOk();
}
#endif
return PR_FALSE;
}

View File

@@ -0,0 +1,72 @@
/* -*- 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 __nsGtkEventHandler_h
#define __nsGtkEventHandler_h
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "gdksuperwin.h"
class nsIWidget;
class nsIMenuItem;
class nsIMenu;
gint handle_configure_event(GtkWidget *w, GdkEventConfigure *conf, gpointer p);
void handle_size_allocate(GtkWidget *w, GtkAllocation *alloc, gpointer p);
gint handle_expose_event(GtkWidget *w, GdkEventExpose *event, gpointer p);
gint handle_key_release_event_for_text(GtkObject *w, GdkEventKey* event, gpointer p);
gint handle_key_press_event_for_text(GtkObject *w, GdkEventKey* event, gpointer p);
gint handle_key_release_event(GtkObject *w, GdkEventKey* event, gpointer p);
gint handle_key_press_event(GtkObject *w, GdkEventKey* event, gpointer p);
void handle_scrollbar_value_changed(GtkAdjustment *adjustment, gpointer p);
void menu_item_activate_handler(GtkWidget *w, gpointer p);
void menu_map_handler(GtkWidget *w, gpointer p);
void menu_unmap_handler(GtkWidget *w, gpointer p);
//----------------------------------------------------
gint nsGtkWidget_FSBCancel_Callback(GtkWidget *w, gpointer p);
gint nsGtkWidget_FSBOk_Callback(GtkWidget *w, gpointer p);
//----------------------------------------------------
gint CheckButton_Toggle_Callback(GtkWidget *w, gpointer p);
gint nsGtkWidget_RadioButton_ArmCallback(GtkWidget *w, gpointer p);
gint nsGtkWidget_RadioButton_DisArmCallback(GtkWidget *w, gpointer p);
gint nsGtkWidget_Text_Callback(GtkWidget *w, GdkEventKey* event, gpointer p);
gint nsGtkWidget_Expose_Callback(GtkWidget *w, gpointer p);
gint nsGtkWidget_Refresh_Callback(gpointer call_data);
void handle_xlib_shell_event(GdkSuperWin *superwin, XEvent *event, gpointer p);
void handle_xlib_bin_event(GdkSuperWin *superwin, XEvent *event, gpointer p);
void handle_gdk_event (GdkEvent *event, gpointer data);
#endif // __nsGtkEventHandler.h

View File

@@ -0,0 +1,213 @@
/* -*- 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 <unistd.h>
#include <string.h>
#include "nsGtkUtils.h"
#include <gdk/gdkx.h>
#include <gdk/gdkprivate.h>
#if defined(__osf__) && !defined(_XOPEN_SOURCE_EXTENDED)
/*
** DEC's compiler requires _XOPEN_SOURCE_EXTENDED to be defined in
** order for it to see the prototype for usleep in unistd.h, but if
** we define that the build breaks long before getting here. So
** put the prototype here explicitly.
*/
int usleep(useconds_t);
#endif
#if defined(__QNX__)
#define usleep(s) sleep(s)
#endif
//////////////////////////////////////////////////////////////////
#if 0
/* staitc */ gint
nsGtkUtils::gdk_query_pointer(GdkWindow * window,
gint * x_out,
gint * y_out)
{
g_return_val_if_fail(NULL != window, FALSE);
g_return_val_if_fail(NULL != x_out, FALSE);
g_return_val_if_fail(NULL != y_out, FALSE);
Window root;
Window child;
int rootx, rooty;
int winx = 0;
int winy = 0;
unsigned int xmask = 0;
gint result = FALSE;
*x_out = -1;
*y_out = -1;
result = XQueryPointer(GDK_WINDOW_XDISPLAY(window),
GDK_WINDOW_XWINDOW(window),
&root,
&child,
&rootx,
&rooty,
&winx,
&winy,
&xmask);
if (result)
{
*x_out = rootx;
*y_out = rooty;
}
return result;
}
#endif
//////////////////////////////////////////////////////////////////
/* static */ void
nsGtkUtils::gtk_widget_set_color(GtkWidget * widget,
GtkRcFlags flags,
GtkStateType state,
GdkColor * color)
{
GtkRcStyle * rc_style;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (color != NULL);
g_return_if_fail (flags == 0);
rc_style = (GtkRcStyle *) gtk_object_get_data (GTK_OBJECT (widget),
"modify-style");
if (!rc_style)
{
rc_style = gtk_rc_style_new ();
gtk_widget_modify_style (widget, rc_style);
gtk_object_set_data (GTK_OBJECT (widget), "modify-style", rc_style);
}
if (flags & GTK_RC_FG)
{
rc_style->color_flags[state] = GtkRcFlags(rc_style->color_flags[state] | GTK_RC_FG);
rc_style->fg[state] = *color;
}
if (flags & GTK_RC_BG)
{
rc_style->color_flags[state] = GtkRcFlags(rc_style->color_flags[state] | GTK_RC_BG);
rc_style->bg[state] = *color;
}
if (flags & GTK_RC_TEXT)
{
rc_style->color_flags[state] = GtkRcFlags(rc_style->color_flags[state] | GTK_RC_TEXT);
rc_style->text[state] = *color;
}
if (flags & GTK_RC_BASE)
{
rc_style->color_flags[state] = GtkRcFlags(rc_style->color_flags[state] | GTK_RC_BASE);
rc_style->base[state] = *color;
}
}
//////////////////////////////////////////////////////////////////
/* static */ GdkModifierType
nsGtkUtils::gdk_keyboard_get_modifiers()
{
GdkModifierType m = (GdkModifierType) 0;
gdk_window_get_pointer(NULL,NULL,NULL,&m);
return m;
}
//////////////////////////////////////////////////////////////////
/* static */ void
nsGtkUtils::gdk_window_flash(GdkWindow * aGdkWindow,
unsigned int aTimes,
unsigned long aInterval,
GdkRectangle * aArea)
{
gint x;
gint y;
gint width;
gint height;
guint i;
GdkGC * gc = 0;
GdkColor white;
gdk_window_get_geometry(aGdkWindow,
NULL,
NULL,
&width,
&height,
NULL);
gdk_window_get_origin (aGdkWindow,
&x,
&y);
gc = gdk_gc_new(GDK_ROOT_PARENT());
white.pixel = WhitePixel(gdk_display,DefaultScreen(gdk_display));
gdk_gc_set_foreground(gc,&white);
gdk_gc_set_function(gc,GDK_XOR);
gdk_gc_set_subwindow(gc,GDK_INCLUDE_INFERIORS);
/*
* If an area is given, use that. Notice how out of whack coordinates
* and dimentsions are not checked!!!
*/
if (aArea)
{
x += aArea->x;
y += aArea->y;
width = aArea->width;
height = aArea->height;
}
/*
* Need to do this twice so that the XOR effect can replace
* the original window contents.
*/
for (i = 0; i < aTimes * 2; i++)
{
gdk_draw_rectangle(GDK_ROOT_PARENT(),
gc,
TRUE,
x,
y,
width,
height);
gdk_flush();
usleep(aInterval);
}
gdk_gc_destroy(gc);
}
//////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,85 @@
/* -*- 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 __nsGtkUtils_h
#define __nsGtkUtils_h
#include <gtk/gtk.h>
struct nsGtkUtils
{
//
// Wrapper for XQueryPointer
//
#if 0
static gint gdk_query_pointer(GdkWindow * window,
gint * x_out,
gint * y_out);
#endif
//
// Change a widget's background
//
// flags isa bit mask of the following bits:
//
// GTK_RC_FG
// GTK_RC_BG
// GTK_RC_TEXT
// GTK_RC_BASE
//
// state is an enum:
//
// GTK_STATE_NORMAL,
// GTK_STATE_ACTIVE,
// GTK_STATE_PRELIGHT,
// GTK_STATE_SELECTED,
// GTK_STATE_INSENSITIVE
//
static void gtk_widget_set_color(GtkWidget * widget,
GtkRcFlags flags,
GtkStateType state,
GdkColor * color);
/**
* Return the current keyboard modifier state.
*
* @return the current keyboard modifier state.
*
*/
static GdkModifierType gdk_keyboard_get_modifiers();
/**
* Flash an area within a GDK window (or the whole window)
*
* @param aGdkWindow The GDK window to flash.
* @param aTimes Number of times to flash the area.
* @param aInterval Interval between flashes in milliseconds.
* @param aArea The area to flash. The whole window if NULL.
*
*/
static void gdk_window_flash(GdkWindow * aGdkWindow,
unsigned int aTimes,
unsigned long aInterval,
GdkRectangle * aArea);
};
#endif // __nsGtkEventHandler.h

View File

@@ -0,0 +1,141 @@
/* -*- 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 <gtk/gtk.h>
#include "nsLabel.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsLabel, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsLabel, nsWidget)
NS_IMPL_QUERY_INTERFACE2(nsLabel, nsILabel, nsIWidget)
//-------------------------------------------------------------------------
//
// nsLabel constructor
//
//-------------------------------------------------------------------------
nsLabel::nsLabel() : nsWidget(), nsILabel()
{
NS_INIT_REFCNT();
mAlignment = eAlign_Left;
}
//-------------------------------------------------------------------------
//
// nsLabel destructor
//
//-------------------------------------------------------------------------
nsLabel::~nsLabel()
{
}
//-------------------------------------------------------------------------
//
// Create the nativeLabel widget
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsLabel::CreateNative(GtkObject *parentWindow)
{
unsigned char alignment = GetNativeAlignment();
mWidget = gtk_label_new("");
gtk_widget_set_name(mWidget, "nsLabel");
gtk_misc_set_alignment(GTK_MISC(mWidget), 0.0, alignment);
return NS_OK;
}
//-------------------------------------------------------------------------
//
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsLabel::PreCreateWidget(nsWidgetInitData *aInitData)
{
if (nsnull != aInitData) {
nsLabelInitData* data = (nsLabelInitData *) aInitData;
mAlignment = data->mAlignment;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set alignment
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsLabel::SetAlignment(nsLabelAlignment aAlignment)
{
GtkJustification align;
mAlignment = aAlignment;
align = GetNativeAlignment();
gtk_misc_set_alignment(GTK_MISC(mWidget), 0.0, align);
return NS_OK;
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
GtkJustification nsLabel::GetNativeAlignment()
{
switch (mAlignment) {
case eAlign_Right : return GTK_JUSTIFY_RIGHT;
case eAlign_Left : return GTK_JUSTIFY_LEFT;
case eAlign_Center: return GTK_JUSTIFY_CENTER;
default :
return GTK_JUSTIFY_LEFT;
}
return GTK_JUSTIFY_LEFT;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::SetLabel(const nsString& aText)
{
NS_ALLOC_STR_BUF(label, aText, 256);
gtk_label_set(GTK_LABEL(mWidget), label);
NS_FREE_STR_BUF(label);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsLabel::GetLabel(nsString& aBuffer)
{
char * text;
gtk_label_get(GTK_LABEL(mWidget), &text);
aBuffer.SetLength(0);
aBuffer.Append(text);
return NS_OK;
}

View File

@@ -0,0 +1,62 @@
/* -*- 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 nsLabel_h__
#define nsLabel_h__
#include "nsWidget.h"
#include "nsILabel.h"
/**
* Native GTK+ Label wrapper
*/
class nsLabel : public nsWidget,
public nsILabel
{
public:
nsLabel();
virtual ~nsLabel();
NS_DECL_ISUPPORTS_INHERITED
// nsILabel part
NS_IMETHOD SetLabel(const nsString &aText);
NS_IMETHOD GetLabel(nsString &aBuffer);
NS_IMETHOD SetAlignment(nsLabelAlignment aAlignment);
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aInitData);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY) { return PR_FALSE; }
virtual PRBool OnResize(nsRect &aRect) { return PR_FALSE; }
protected:
NS_METHOD CreateNative(GtkObject *parentWindow);
GtkJustification GetNativeAlignment();
nsLabelAlignment mAlignment;
};
#endif // nsLabel_h__

View File

@@ -0,0 +1,394 @@
/* -*- 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 <gtk/gtk.h>
#include "nsListBox.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsListBox, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsListBox, nsWidget)
NS_IMPL_QUERY_INTERFACE3(nsListBox, nsIListBox, nsIListWidget, nsIWidget)
//-------------------------------------------------------------------------
//
// nsListBox constructor
//
//-------------------------------------------------------------------------
nsListBox::nsListBox() : nsWidget(), nsIListWidget(), nsIListBox()
{
NS_INIT_REFCNT();
mMultiSelect = PR_FALSE;
mCList = nsnull;
}
//-------------------------------------------------------------------------
//
// nsListBox:: destructor
//
//-------------------------------------------------------------------------
nsListBox::~nsListBox()
{
}
void nsListBox::InitCallbacks(char * aName)
{
InstallButtonPressSignal(mCList);
InstallButtonReleaseSignal(mCList);
InstallEnterNotifySignal(mCList);
InstallLeaveNotifySignal(mCList);
// These are needed so that the events will go to us and not our parent.
AddToEventMask(mCList,
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
}
//-------------------------------------------------------------------------
//
// initializer
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
{
mMultiSelect = aMultipleSelections;
if (mCList) {
if (mMultiSelect)
gtk_clist_set_selection_mode(GTK_CLIST(mCList), GTK_SELECTION_MULTIPLE);
else
gtk_clist_set_selection_mode(GTK_CLIST(mCList), GTK_SELECTION_BROWSE);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// AddItemAt
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
{
if (mCList) {
gchar *text[2];
const nsAutoCString tempStr(aItem);
text[0] = (gchar*)(const char *)tempStr;
text[1] = (gchar*)NULL;
gtk_clist_insert(GTK_CLIST(mCList), (int)aPosition, text);
// XXX Im not sure using the string address is the right thing to
// store in the row data.
gtk_clist_set_row_data(GTK_CLIST(mCList), aPosition, (gpointer)&aItem);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Finds an item at a postion
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::FindItem(nsString &aItem, PRInt32 aStartPos)
{
int i = -1;
if (mCList) {
i = gtk_clist_find_row_from_data(GTK_CLIST(mCList), (gpointer)&aItem);
if (i < aStartPos) {
i = -1;
}
}
return i;
}
//-------------------------------------------------------------------------
//
// CountItems - Get Item Count
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetItemCount()
{
if (mCList) {
return GTK_CLIST(mCList)->rows;
}
else {
return 0;
}
}
//-------------------------------------------------------------------------
//
// Removes an Item at a specified location
//
//-------------------------------------------------------------------------
PRBool nsListBox::RemoveItemAt(PRInt32 aPosition)
{
if (mCList) {
gtk_clist_remove(GTK_CLIST(mCList), aPosition);
}
return PR_TRUE;
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
{
PRBool result = PR_FALSE;
anItem.Truncate();
if (mCList) {
char *text = nsnull;
gtk_clist_get_text(GTK_CLIST(mCList),aPosition,0,&text);
if (text) {
anItem.Append(text);
result = PR_TRUE;
}
}
return result;
}
//-------------------------------------------------------------------------
//
// Gets the selected of selected item
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::GetSelectedItem(nsString& aItem)
{
aItem.Truncate();
if (mCList) {
PRInt32 i=0, idx=-1;
GtkCList *clist = GTK_CLIST(mCList);
GList *list = clist->row_list;
for (i=0; i < clist->rows && idx == -1; i++, list = list->next) {
if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) {
char *text = nsnull;
gtk_clist_get_text(GTK_CLIST(mCList),i,0,&text);
if (text) {
aItem.Append(text);
}
return NS_OK;
}
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Gets the list of selected otems
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetSelectedIndex()
{
PRInt32 i=0, idx=-1;
if (mCList) {
if (!mMultiSelect) {
GtkCList *clist = GTK_CLIST(mCList);
GList *list = clist->row_list;
for (i=0; i < clist->rows && idx == -1; i++, list = list->next) {
if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) {
idx = i;
}
}
} else {
NS_ASSERTION(PR_FALSE, "Multi selection list box does not support GetSelectedIndex()");
}
}
return idx;
}
//-------------------------------------------------------------------------
//
// SelectItem
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::SelectItem(PRInt32 aPosition)
{
if (mCList) {
gtk_clist_select_row(GTK_CLIST(mCList), aPosition, 0);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// GetSelectedCount
//
//-------------------------------------------------------------------------
PRInt32 nsListBox::GetSelectedCount()
{
if (mCList) {
if (!GTK_CLIST(mCList)->selection)
return 0;
else
return (PRInt32)g_list_length(GTK_CLIST(mCList)->selection);
}
else {
return 0;
}
}
//-------------------------------------------------------------------------
//
// GetSelectedIndices
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
{
if (mCList) {
PRInt32 i=0, num = 0;
GtkCList *clist = GTK_CLIST(mCList);
GList *list = clist->row_list;
for (i=0; i < clist->rows && num < aSize; i++, list = list->next) {
if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) {
aIndices[num] = i;
num++;
}
}
}
else {
PRInt32 i = 0;
for (i = 0; i < aSize; i++) aIndices[i] = 0;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// SetSelectedIndices
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
{
if (mCList) {
gtk_clist_unselect_all(GTK_CLIST(mCList));
int i;
for (i=0;i<aSize;i++) {
SelectItem(aIndices[i]);
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Deselect
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::Deselect()
{
if (mCList) {
gtk_clist_unselect_all(GTK_CLIST(mCList));
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set initial parameters
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::PreCreateWidget(nsWidgetInitData *aInitData)
{
if (nsnull != aInitData) {
nsListBoxInitData* data = (nsListBoxInitData *) aInitData;
mMultiSelect = data->mMultiSelect;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Create the native widget
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::CreateNative(GtkObject *parentWindow)
{
// to handle scrolling
mWidget = gtk_scrolled_window_new (nsnull, nsnull);
gtk_widget_set_name(mWidget, "nsListBox");
gtk_container_set_border_width(GTK_CONTAINER(mWidget), 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (mWidget),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
mCList = ::gtk_clist_new(1);
gtk_clist_column_titles_hide(GTK_CLIST(mCList));
// Default (it may be changed)
gtk_clist_set_selection_mode(GTK_CLIST(mCList), GTK_SELECTION_BROWSE);
SetMultipleSelection(mMultiSelect);
gtk_widget_show(mCList);
gtk_signal_connect(GTK_OBJECT(mCList),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
gtk_container_add (GTK_CONTAINER (mWidget), mCList);
return NS_OK;
}
void
nsListBox::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mCList) {
mCList = nsnull;
}
else {
nsWidget::OnDestroySignal(aGtkWidget);
}
}
//-------------------------------------------------------------------------
//
// set font for listbox
//
//-------------------------------------------------------------------------
/*virtual*/
void nsListBox::SetFontNative(GdkFont *aFont)
{
GtkStyle *style = gtk_style_copy(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0))->style);
// gtk_style_copy ups the ref count of the font
gdk_font_unref (style->font);
style->font = aFont;
gdk_font_ref(style->font);
gtk_widget_set_style(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0)), style);
gtk_style_unref(style);
}

View File

@@ -0,0 +1,70 @@
/* -*- 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 nsListBox_h__
#define nsListBox_h__
#include "nsWidget.h"
#include "nsIListBox.h"
/**
* Native GTK+ Listbox wrapper
*/
class nsListBox : public nsWidget,
public nsIListWidget,
public nsIListBox
{
public:
nsListBox();
virtual ~nsListBox();
NS_DECL_ISUPPORTS_INHERITED
// nsIListBox interface
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aInitData);
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections);
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition);
PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos);
PRInt32 GetItemCount();
PRBool RemoveItemAt(PRInt32 aPosition);
PRBool GetItemAt(nsString& anItem, PRInt32 aPosition);
NS_IMETHOD GetSelectedItem(nsString& aItem);
PRInt32 GetSelectedIndex();
PRInt32 GetSelectedCount();
NS_IMETHOD GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
NS_IMETHOD SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
NS_IMETHOD SelectItem(PRInt32 aPosition);
NS_IMETHOD Deselect() ;
virtual void SetFontNative(GdkFont *aFont);
protected:
NS_IMETHOD CreateNative(GtkObject *parentWindow);
virtual void InitCallbacks(char * aName = nsnull);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
GtkWidget *mCList;
PRBool mMultiSelect;
};
#endif // nsListBox_h__

View File

@@ -0,0 +1,316 @@
/* -*- 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 "nsLookAndFeel.h"
#include <gtk/gtkinvisible.h>
#define GDK_COLOR_TO_NS_RGB(c) \
((nscolor) NS_RGB(c.red, c.green, c.blue))
NS_IMPL_ISUPPORTS1(nsLookAndFeel, nsILookAndFeel)
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsLookAndFeel::nsLookAndFeel()
{
NS_INIT_REFCNT();
mWidget = gtk_invisible_new();
gtk_widget_ensure_style(mWidget);
mStyle = gtk_widget_get_style(mWidget);
}
nsLookAndFeel::~nsLookAndFeel()
{
gtk_widget_destroy(mWidget);
}
NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
{
nsresult res = NS_OK;
aColor = 0; // default color black
switch (aID) {
case eColor_WindowBackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_WindowForeground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_WidgetBackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_WidgetForeground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_WidgetSelectBackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]);
break;
case eColor_WidgetSelectForeground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_SELECTED]);
break;
case eColor_Widget3DHighlight:
aColor = NS_RGB(0xa0,0xa0,0xa0);
break;
case eColor_Widget3DShadow:
aColor = NS_RGB(0x40,0x40,0x40);
break;
case eColor_TextBackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_TextForeground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_TextSelectBackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]);
break;
case eColor_TextSelectForeground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_SELECTED]);
break;
// css2 http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
case eColor_activeborder:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_activecaption:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_appworkspace:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_background:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_captiontext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_graytext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_INSENSITIVE]);
break;
case eColor_highlight:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]);
break;
case eColor_highlighttext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_SELECTED]);
break;
case eColor_inactiveborder:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_inactivecaption:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_INSENSITIVE]);
break;
case eColor_inactivecaptiontext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_INSENSITIVE]);
break;
case eColor_infobackground:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_infotext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_menu:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_menutext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_scrollbar:
break;
case eColor_threedface:
case eColor_buttonface:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_buttonhighlight: // ?
case eColor_threedhighlight:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_ACTIVE]);
break;
case eColor_buttontext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
case eColor_buttonshadow:
case eColor_threeddarkshadow:
case eColor_threedshadow: // i think these should be the same
aColor = NS_DarkenColor(NS_DarkenColor(NS_DarkenColor(NS_DarkenColor(NS_DarkenColor(GDK_COLOR_TO_NS_RGB(mStyle->light[GTK_STATE_NORMAL]))))));
// aColor = GDK_COLOR_TO_NS_RGB(mStyle->dark[GTK_STATE_NORMAL]); // dark style gives me bright green?!
break;
case eColor_threedlightshadow:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->light[GTK_STATE_NORMAL]);
break;
case eColor_window:
case eColor_windowframe:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
break;
case eColor_windowtext:
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
break;
default:
/* default color is BLACK */
aColor = 0;
res = NS_ERROR_FAILURE;
break;
}
// printf("%i, %i, %i\n", NS_GET_R(aColor), NS_GET_B(aColor), NS_GET_G(aColor));
return res;
}
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
{
nsresult res = NS_OK;
switch (aID) {
case eMetric_WindowTitleHeight:
aMetric = 0;
break;
case eMetric_WindowBorderWidth:
// aMetric = mStyle->klass->xthickness;
break;
case eMetric_WindowBorderHeight:
// aMetric = mStyle->klass->ythickness;
break;
case eMetric_Widget3DBorder:
// aMetric = 4;
break;
case eMetric_TextFieldHeight:
{
GtkRequisition req;
GtkWidget *text = gtk_entry_new();
// needed to avoid memory leak
gtk_widget_ref(text);
gtk_object_sink(GTK_OBJECT(text));
gtk_widget_size_request(text,&req);
aMetric = req.height;
gtk_widget_destroy(text);
gtk_widget_unref(text);
}
break;
case eMetric_TextFieldBorder:
aMetric = 2;
break;
case eMetric_TextVerticalInsidePadding:
aMetric = 0;
break;
case eMetric_TextShouldUseVerticalInsidePadding:
aMetric = 0;
break;
case eMetric_TextHorizontalInsideMinimumPadding:
aMetric = 15;
break;
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
aMetric = 1;
break;
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
aMetric = 10;
break;
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
aMetric = 8;
break;
case eMetric_CheckboxSize:
aMetric = 15;
break;
case eMetric_RadioboxSize:
aMetric = 15;
break;
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
aMetric = 15;
break;
case eMetric_ListHorizontalInsideMinimumPadding:
aMetric = 15;
break;
case eMetric_ListShouldUseVerticalInsidePadding:
aMetric = 1;
break;
case eMetric_ListVerticalInsidePadding:
aMetric = 1;
break;
case eMetric_CaretBlinkTime:
aMetric = 500;
break;
case eMetric_CaretWidthTwips:
aMetric = 20;
break;
default:
aMetric = 0;
res = NS_ERROR_FAILURE;
}
return res;
}
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
{
nsresult res = NS_OK;
switch (aID) {
case eMetricFloat_TextFieldVerticalInsidePadding:
aMetric = 0.25f;
break;
case eMetricFloat_TextFieldHorizontalInsidePadding:
aMetric = 0.95f; // large number on purpose so minimum padding is used
break;
case eMetricFloat_TextAreaVerticalInsidePadding:
aMetric = 0.40f;
break;
case eMetricFloat_TextAreaHorizontalInsidePadding:
aMetric = 0.40f; // large number on purpose so minimum padding is used
break;
case eMetricFloat_ListVerticalInsidePadding:
aMetric = 0.10f;
break;
case eMetricFloat_ListHorizontalInsidePadding:
aMetric = 0.40f;
break;
case eMetricFloat_ButtonVerticalInsidePadding:
aMetric = 0.25f;
break;
case eMetricFloat_ButtonHorizontalInsidePadding:
aMetric = 0.25f;
break;
default:
aMetric = -1.0;
res = NS_ERROR_FAILURE;
}
return res;
}
#ifdef NS_DEBUG
NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
const nsMetricNavFontID aFontID,
const PRInt32 aFontSize,
nsSize &aSize)
{
aSize.width = 0;
aSize.height = 0;
return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

View File

@@ -0,0 +1,55 @@
/* -*- 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 __nsLookAndFeel
#define __nsLookAndFeel
#include "nsILookAndFeel.h"
#include <gtk/gtk.h>
class nsLookAndFeel: public nsILookAndFeel {
NS_DECL_ISUPPORTS
public:
nsLookAndFeel();
virtual ~nsLookAndFeel();
NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor);
NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
#ifdef NS_DEBUG
// 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);
#endif
protected:
GtkStyle *mStyle;
GtkWidget *mWidget;
};
#endif

View File

@@ -0,0 +1,792 @@
/* -*- 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 <gtk/gtk.h>
#include "nsMenu.h"
#include "nsIComponentManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIMenuBar.h"
#include "nsIMenuItem.h"
#include "nsIMenuListener.h"
#include "nsString.h"
#include "nsGtkEventHandler.h"
#include "nsCOMPtr.h"
#include "nsWidgetsCID.h"
static NS_DEFINE_CID(kMenuCID, NS_MENU_CID);
static NS_DEFINE_CID(kMenuItemCID, NS_MENUITEM_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsresult nsMenu::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(nsIMenu::GetIID())) {
*aInstancePtr = (void*)(nsIMenu*) this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)(nsIMenu*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIMenuListener::GetIID())) {
*aInstancePtr = (void*)(nsIMenuListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsMenu)
NS_IMPL_RELEASE(nsMenu)
//-------------------------------------------------------------------------
//
// nsMenu constructor
//
//-------------------------------------------------------------------------
nsMenu::nsMenu() : nsIMenu()
{
NS_INIT_REFCNT();
mNumMenuItems = 0;
mMenu = nsnull;
mMenuParent = nsnull;
mMenuBarParent = nsnull;
mListener = nsnull;
mConstructCalled = PR_FALSE;
mDOMNode = nsnull;
mWebShell = nsnull;
mDOMElement = nsnull;
mAccessKey = "_";
}
//-------------------------------------------------------------------------
//
// nsMenu destructor
//
//-------------------------------------------------------------------------
nsMenu::~nsMenu()
{
//g_print("nsMenu::~nsMenu() called\n");
NS_IF_RELEASE(mListener);
// Free our menu items
RemoveAll();
gtk_widget_destroy(mMenu);
mMenu = nsnull;
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//-------------------------------------------------------------------------
NS_METHOD nsMenu::Create(nsISupports *aParent, const nsString &aLabel)
{
if(aParent)
{
nsIMenuBar * menubar = nsnull;
aParent->QueryInterface(nsIMenuBar::GetIID(), (void**) &menubar);
if(menubar)
{
mMenuBarParent = menubar;
NS_RELEASE(menubar);
}
else
{
nsIMenu * menu = nsnull;
aParent->QueryInterface(nsIMenu::GetIID(), (void**) &menu);
if(menu)
{
mMenuParent = menu;
NS_RELEASE(menu);
}
}
}
mLabel = aLabel;
mMenu = gtk_menu_new();
gtk_signal_connect (GTK_OBJECT (mMenu), "map",
GTK_SIGNAL_FUNC(menu_map_handler),
this);
gtk_signal_connect (GTK_OBJECT (mMenu), "unmap",
GTK_SIGNAL_FUNC(menu_unmap_handler),
this);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetParent(nsISupports*& aParent)
{
aParent = nsnull;
if (nsnull != mMenuParent) {
return mMenuParent->QueryInterface(kISupportsIID,
(void**)&aParent);
} else if (nsnull != mMenuBarParent) {
return mMenuBarParent->QueryInterface(kISupportsIID,
(void**)&aParent);
}
return NS_ERROR_FAILURE;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetLabel(nsString &aText)
{
aText = mLabel;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::SetLabel(const nsString &aText)
{
/* we Do GetLabel() when we are adding the menu...
* but we might want to redo this.
*/
mLabel = aText;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetAccessKey(nsString &aText)
{
aText = mAccessKey;
char *foo = mAccessKey.ToNewCString();
#ifdef DEBUG_pavlov
g_print("GetAccessKey returns \"%s\"\n", foo);
#endif
nsCRT::free(foo);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::SetAccessKey(const nsString &aText)
{
mAccessKey = aText;
char *foo = mAccessKey.ToNewCString();
#ifdef DEBUG_pavlov
g_print("SetAccessKey setting to \"%s\"\n", foo);
#endif
nsCRT::free(foo);
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Set enabled state
*
*/
NS_METHOD nsMenu::SetEnabled(PRBool aIsEnabled)
{
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Get enabled state
*
*/
NS_METHOD nsMenu::GetEnabled(PRBool* aIsEnabled)
{
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Query if this is the help menu
*
*/
NS_METHOD nsMenu::IsHelpMenu(PRBool* aIsHelpMenu)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::AddItem(nsISupports * aItem)
{
if(aItem)
{
nsIMenuItem * menuitem = nsnull;
aItem->QueryInterface(nsIMenuItem::GetIID(),
(void**)&menuitem);
if(menuitem)
{
AddMenuItem(menuitem); // nsMenu now owns this
NS_RELEASE(menuitem);
}
else
{
nsIMenu * menu = nsnull;
aItem->QueryInterface(nsIMenu::GetIID(),
(void**)&menu);
if(menu)
{
AddMenu(menu); // nsMenu now owns this
NS_RELEASE(menu);
}
}
}
return NS_OK;
}
// local method used by nsMenu::AddItem
//-------------------------------------------------------------------------
NS_METHOD nsMenu::AddMenuItem(nsIMenuItem * aMenuItem)
{
GtkWidget *widget;
void *voidData;
aMenuItem->GetNativeData(voidData);
widget = GTK_WIDGET(voidData);
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
// XXX add aMenuItem to internal data structor list
// Need to be adding an nsISupports *, not nsIMenuItem *
nsISupports * supports = nsnull;
aMenuItem->QueryInterface(kISupportsIID,
(void**)&supports);
{
mMenuItemVoidArray.AppendElement(supports);
mNumMenuItems++;
}
return NS_OK;
}
// local method used by nsMenu::AddItem
//-------------------------------------------------------------------------
NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu)
{
nsString Label;
GtkWidget *newmenu=nsnull;
void *voidData=NULL;
aMenu->GetLabel(Label);
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuItemCID,
nsnull,
nsIMenuItem::GetIID(),
(void**)&pnsMenuItem);
if (NS_OK == rv) {
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, Label, PR_FALSE); //PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
void * menuitem = nsnull;
pnsMenuItem->GetNativeData(menuitem);
voidData = NULL;
aMenu->GetNativeData(&voidData);
newmenu = GTK_WIDGET(voidData);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), newmenu);
NS_RELEASE(pnsMenuItem);
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::AddSeparator()
{
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(
kMenuItemCID, nsnull, nsIMenuItem::GetIID(), (void**)&pnsMenuItem);
if (NS_OK == rv) {
nsString tmp = "menuseparator";
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, tmp, PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
NS_RELEASE(pnsMenuItem);
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetItemCount(PRUint32 &aCount)
{
// this should be right.. does it need to be +1 ?
aCount = g_list_length(GTK_MENU_SHELL(mMenu)->children);
//g_print("nsMenu::GetItemCount = %i\n", aCount);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetItemAt(const PRUint32 aPos,
nsISupports *&aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::InsertItemAt(const PRUint32 aPos,
nsISupports *aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::RemoveItem(const PRUint32 aPos)
{
#if 0
// this may work here better than Removeall(), but i'm not sure how to test this one
nsISupports *item = mMenuItemVoidArray[aPos];
delete item;
mMenuItemVoidArray.RemoveElementAt(aPos);
#endif
/*
gtk_menu_shell_remove (GTK_MENU_SHELL (mMenu), item);
nsCRT::free(labelStr);
voidData = NULL;
aMenu->GetNativeData(&voidData);
newmenu = GTK_WIDGET(voidData);
gtk_menu_item_remove_submenu (GTK_MENU_ITEM (item));
*/
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::RemoveAll()
{
//g_print("nsMenu::RemoveAll()\n");
#if 0
// this doesn't work quite right, but this is about all that should really be needed
int i=0;
nsIMenu *menu = nsnull;
nsIMenuItem *menuitem = nsnull;
nsISupports *item = nsnull;
for (i=mMenuItemVoidArray.Count(); i>0; i--)
{
item = (nsISupports*)mMenuItemVoidArray[i-1];
if(nsnull != item)
{
if (NS_OK == item->QueryInterface(nsIMenuItem::GetIID(), (void**)&menuitem)) {
// we do this twice because we have to do it once for QueryInterface,
// then we want to get rid of it.
// g_print("remove nsMenuItem\n");
NS_RELEASE(menuitem);
NS_RELEASE(item);
menuitem = nsnull;
} else if (NS_OK == item->QueryInterface(nsIMenu::GetIID(), (void**)&menu)) {
// g_print("remove nsMenu\n");
NS_RELEASE(menu);
NS_RELEASE(item);
menu = nsnull;
}
// mMenuItemVoidArray.RemoveElementAt(i-1);
}
}
mMenuItemVoidArray.Clear();
#else
for (int i = mMenuItemVoidArray.Count(); i > 0; i--) {
if(nsnull != mMenuItemVoidArray[i-1]) {
nsIMenuItem * menuitem = nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(nsIMenuItem::GetIID(),
(void**)&menuitem);
if(menuitem) {
void *gtkmenuitem = nsnull;
menuitem->GetNativeData(gtkmenuitem);
if (gtkmenuitem) {
// gtk_widget_ref(GTK_WIDGET(gtkmenuitem));
//gtk_widget_destroy(GTK_WIDGET(gtkmenuitem));
gtk_container_remove (GTK_CONTAINER (mMenu), GTK_WIDGET(gtkmenuitem));
}
} else {
nsIMenu * menu= nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(nsIMenu::GetIID(),
(void**)&menu);
if(menu)
{
void * gtkmenu = nsnull;
menu->GetNativeData(&gtkmenu);
if(gtkmenu){
//g_print("gtkmenu removed");
//gtk_menu_item_remove_submenu (GTK_MENU_ITEM (item));
}
}
}
}
}
#endif
//g_print("end RemoveAll\n");
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetNativeData(void ** aData)
{
*aData = (void *)mMenu;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::SetNativeData(void * aData)
{
return NS_OK;
}
GtkWidget *nsMenu::GetNativeParent()
{
void * voidData;
if (nsnull != mMenuParent) {
mMenuParent->GetNativeData(&voidData);
} else if (nsnull != mMenuBarParent) {
mMenuBarParent->GetNativeData(voidData);
} else {
return nsnull;
}
return GTK_WIDGET(voidData);
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::AddMenuListener(nsIMenuListener * aMenuListener)
{
mListener = aMenuListener;
NS_ADDREF(mListener);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::RemoveMenuListener(nsIMenuListener * aMenuListener)
{
if (aMenuListener == mListener) {
NS_IF_RELEASE(mListener);
}
return NS_OK;
}
//-------------------------------------------------------------------------
// nsIMenuListener interface
//-------------------------------------------------------------------------
nsEventStatus nsMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
if (nsnull != mListener) {
mListener->MenuSelected(aMenuEvent);
}
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
{
if (nsnull != mListener) {
mListener->MenuSelected(aMenuEvent);
}
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenu::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
if (nsnull != mListener) {
mListener->MenuDeselected(aMenuEvent);
}
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenu::MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menuNode,
void * aWebShell)
{
//g_print("nsMenu::MenuConstruct called \n");
if(menuNode){
SetDOMNode((nsIDOMNode*)menuNode);
}
if(!aWebShell){
aWebShell = mWebShell;
}
// First open the menu.
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mDOMNode);
if (domElement)
domElement->SetAttribute("open", "true");
/// Now get the kids. Retrieve our menupopup child.
nsCOMPtr<nsIDOMNode> menuPopupNode;
mDOMNode->GetFirstChild(getter_AddRefs(menuPopupNode));
while (menuPopupNode) {
nsCOMPtr<nsIDOMElement> menuPopupElement(do_QueryInterface(menuPopupNode));
if (menuPopupElement) {
nsString menuPopupNodeType;
menuPopupElement->GetNodeName(menuPopupNodeType);
if (menuPopupNodeType.Equals("menupopup"))
break;
}
nsCOMPtr<nsIDOMNode> oldMenuPopupNode(menuPopupNode);
oldMenuPopupNode->GetNextSibling(getter_AddRefs(menuPopupNode));
}
if (!menuPopupNode)
return nsEventStatus_eIgnore;
nsCOMPtr<nsIDOMNode> menuitemNode;
menuPopupNode->GetFirstChild(getter_AddRefs(menuitemNode));
unsigned short menuIndex = 0;
while (menuitemNode) {
nsCOMPtr<nsIDOMElement> menuitemElement(do_QueryInterface(menuitemNode));
if (menuitemElement) {
nsString menuitemNodeType;
nsString menuitemName;
menuitemElement->GetNodeName(menuitemNodeType);
if (menuitemNodeType.Equals("menuitem")) {
// LoadMenuItem
LoadMenuItem(this,
menuitemElement,
menuitemNode,
menuIndex,
(nsIWebShell*)aWebShell);
} else if (menuitemNodeType.Equals("menuseparator")) {
AddSeparator();
} else if (menuitemNodeType.Equals("menu")) {
// Load a submenu
LoadSubMenu(this, menuitemElement, menuitemNode);
}
}
++menuIndex;
nsCOMPtr<nsIDOMNode> oldmenuitemNode(menuitemNode);
oldmenuitemNode->GetNextSibling(getter_AddRefs(menuitemNode));
} // end menu item innner loop
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenu::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
// Close the node.
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mDOMNode);
if (domElement)
domElement->RemoveAttribute("open");
//g_print("nsMenu::MenuDestruct called \n");
mConstructCalled = PR_FALSE;
RemoveAll();
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
/**
* Set DOMNode
*
*/
NS_METHOD nsMenu::SetDOMNode(nsIDOMNode * aMenuNode)
{
mDOMNode = aMenuNode;
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Set DOMElement
*
*/
NS_METHOD nsMenu::SetDOMElement(nsIDOMElement * aMenuElement)
{
mDOMElement = aMenuElement;
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Set WebShell
*
*/
NS_METHOD nsMenu::SetWebShell(nsIWebShell * aWebShell)
{
mWebShell = aWebShell;
return NS_OK;
}
//----------------------------------------
void nsMenu::LoadMenuItem(nsIMenu * pParentMenu,
nsIDOMElement * menuitemElement,
nsIDOMNode * menuitemNode,
unsigned short menuitemIndex,
nsIWebShell * aWebShell)
{
static const char* NS_STRING_TRUE = "true";
nsString disabled;
nsString menuitemName;
nsString menuitemCmd;
menuitemElement->GetAttribute(nsAutoString("disabled"), disabled);
menuitemElement->GetAttribute(nsAutoString("value"), menuitemName);
menuitemElement->GetAttribute(nsAutoString("cmd"), menuitemCmd);
// Create nsMenuItem
nsIMenuItem * pnsMenuItem = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuItemCID,
nsnull,
nsIMenuItem::GetIID(),
(void**)&pnsMenuItem);
if (NS_OK == rv) {
pnsMenuItem->Create(pParentMenu, menuitemName, PR_FALSE);
nsISupports * supports = nsnull;
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
pParentMenu->AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
if(disabled == NS_STRING_TRUE ) {
pnsMenuItem->SetEnabled(PR_FALSE);
}
// Create MenuDelegate - this is the intermediator inbetween
// the DOM node and the nsIMenuItem
// The nsWebShellWindow wacthes for Document changes and then notifies the
// the appropriate nsMenuDelegate object
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(menuitemNode));
if (!domElement) {
//return NS_ERROR_FAILURE;
return;
}
nsAutoString cmdAtom("oncommand");
nsString cmdName;
domElement->GetAttribute(cmdAtom, cmdName);
pnsMenuItem->SetCommand(cmdName);
// DO NOT use passed in webshell because of messed up windows dynamic loading
// code.
pnsMenuItem->SetWebShell(mWebShell);
pnsMenuItem->SetDOMElement(domElement);
NS_RELEASE(pnsMenuItem);
}
return;
}
//----------------------------------------
void nsMenu::LoadSubMenu(nsIMenu * pParentMenu,
nsIDOMElement * menuElement,
nsIDOMNode * menuNode)
{
nsString menuName;
menuElement->GetAttribute(nsAutoString("value"), menuName);
//printf("Creating Menu [%s] \n", menuName.ToNewCString()); // this leaks
// Create nsMenu
nsIMenu * pnsMenu = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuCID,
nsnull,
nsIMenu::GetIID(),
(void**)&pnsMenu);
if (NS_OK == rv) {
// Call Create
nsISupports * supports = nsnull;
pParentMenu->QueryInterface(kISupportsIID, (void**) &supports);
pnsMenu->Create(supports, menuName);
NS_RELEASE(supports); // Balance QI
// Set nsMenu Name
pnsMenu->SetLabel(menuName);
supports = nsnull;
pnsMenu->QueryInterface(kISupportsIID, (void**) &supports);
pParentMenu->AddItem(supports); // parent takes ownership
NS_RELEASE(supports);
pnsMenu->SetWebShell(mWebShell);
pnsMenu->SetDOMNode(menuNode);
/*
// Begin menuitem inner loop
unsigned short menuIndex = 0;
nsCOMPtr<nsIDOMNode> menuitemNode;
menuNode->GetFirstChild(getter_AddRefs(menuitemNode));
while (menuitemNode) {
nsCOMPtr<nsIDOMElement> menuitemElement(do_QueryInterface(menuitemNode));
if (menuitemElement) {
nsString menuitemNodeType;
menuitemElement->GetNodeName(menuitemNodeType);
#ifdef DEBUG_saari
printf("Type [%s] %d\n", menuitemNodeType.ToNewCString(), menuitemNodeType.Equals("menuseparator"));
#endif
if (menuitemNodeType.Equals("menuitem")) {
// Load a menuitem
LoadMenuItem(pnsMenu, menuitemElement, menuitemNode, menuIndex, mWebShell);
} else if (menuitemNodeType.Equals("menuseparator")) {
pnsMenu->AddSeparator();
} else if (menuitemNodeType.Equals("menu")) {
// Add a submenu
LoadSubMenu(pnsMenu, menuitemElement, menuitemNode);
}
}
++menuIndex;
nsCOMPtr<nsIDOMNode> oldmenuitemNode(menuitemNode);
oldmenuitemNode->GetNextSibling(getter_AddRefs(menuitemNode));
} // end menu item innner loop
*/
}
}

View File

@@ -0,0 +1,120 @@
/* -*- 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 nsMenu_h__
#define nsMenu_h__
#include "nsIMenu.h"
#include "nsIMenuListener.h"
#include "nsVoidArray.h"
class nsIDOMElement;
class nsIDOMNode;
class nsIMenuBar;
class nsIWebShell;
/**
* Native GTK+ Menu wrapper
*/
class nsMenu : public nsIMenu, public nsIMenuListener
{
public:
nsMenu();
virtual ~nsMenu();
NS_DECL_ISUPPORTS
// nsIMenuListener methods
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(
const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menuNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
NS_IMETHOD Create(nsISupports * aParent, const nsString &aLabel);
// nsIMenu Methods
NS_IMETHOD GetParent(nsISupports *&aParent);
NS_IMETHOD GetLabel(nsString &aText);
NS_IMETHOD SetLabel(const nsString &aText);
NS_IMETHOD GetAccessKey(nsString &aText);
NS_IMETHOD SetAccessKey(const nsString &aText);
NS_IMETHOD AddItem(nsISupports * aItem);
NS_IMETHOD AddMenuItem(nsIMenuItem * aMenuItem);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD AddSeparator();
NS_IMETHOD GetItemCount(PRUint32 &aCount);
NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem);
NS_IMETHOD RemoveItem(const PRUint32 aPos);
NS_IMETHOD RemoveAll();
NS_IMETHOD GetNativeData(void** aData);
NS_IMETHOD SetNativeData(void* aData);
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
NS_IMETHOD GetEnabled(PRBool* aIsEnabled);
NS_IMETHOD IsHelpMenu(PRBool* aIsHelp);
NS_IMETHOD SetDOMNode(nsIDOMNode * aMenuNode);
NS_IMETHOD SetDOMElement(nsIDOMElement * aMenuElement);
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell);
protected:
void LoadMenuItem(
nsIMenu * pParentMenu,
nsIDOMElement * menuitemElement,
nsIDOMNode * menuitemNode,
unsigned short menuitemIndex,
nsIWebShell * aWebShell);
void LoadSubMenu(
nsIMenu * pParentMenu,
nsIDOMElement * menuElement,
nsIDOMNode * menuNode);
GtkWidget *GetNativeParent();
nsString mLabel;
nsString mAccessKey;
PRUint32 mNumMenuItems;
GtkWidget *mMenu;
nsVoidArray mMenuItemVoidArray;
nsIMenu *mMenuParent;
nsIMenuBar *mMenuBarParent;
nsIMenuListener * mListener;
PRBool mConstructCalled;
nsIDOMNode * mDOMNode;
nsIWebShell * mWebShell;
nsIDOMElement * mDOMElement;
};
#endif // nsMenu_h__

View File

@@ -0,0 +1,354 @@
/* -*- 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 <gtk/gtk.h>
#include "nsMenuBar.h"
#include "nsMenuItem.h"
#include "nsIComponentManager.h"
#include "nsIDOMNode.h"
#include "nsIMenu.h"
#include "nsIWebShell.h"
#include "nsIWidget.h"
#include "nsString.h"
#include "nsGtkEventHandler.h"
#include "nsCOMPtr.h"
#include "nsWidgetsCID.h"
static NS_DEFINE_CID(kMenuBarCID, NS_MENUBAR_CID);
static NS_DEFINE_CID(kMenuCID, NS_MENU_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsresult nsMenuBar::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(nsIMenuBar::GetIID())) {
*aInstancePtr = (void*) ((nsIMenuBar*) this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*) ((nsISupports*)(nsIMenuBar*) this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIMenuListener::GetIID())) {
*aInstancePtr = (void*) ((nsIMenuListener*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsMenuBar)
NS_IMPL_RELEASE(nsMenuBar)
//-------------------------------------------------------------------------
//
// nsMenuBar constructor
//
//-------------------------------------------------------------------------
nsMenuBar::nsMenuBar() : nsIMenuBar(), nsIMenuListener()
{
NS_INIT_REFCNT();
mNumMenus = 0;
mMenuBar = nsnull;
mParent = nsnull;
mIsMenuBarAdded = PR_FALSE;
mWebShell = nsnull;
mDOMNode = nsnull;
}
//-------------------------------------------------------------------------
//
// nsMenuBar destructor
//
//-------------------------------------------------------------------------
nsMenuBar::~nsMenuBar()
{
// Release the menus
RemoveAll();
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
{
SetParent(aParent);
mMenuBar = gtk_menu_bar_new();
gtk_widget_show(mMenuBar);
mParent->SetMenuBar(this);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
{
aParent = mParent;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
{
mParent = aParent;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
{
nsString Label;
GtkWidget *widget, *nmenu;
void *voidData;
nsISupports * supports = nsnull;
aMenu->QueryInterface(kISupportsIID, (void**)&supports);
if (supports) {
mMenusVoidArray.AppendElement(aMenu);
mNumMenus++;
}
aMenu->GetLabel(Label);
// get access key
nsString accessKey = " ";
aMenu->GetAccessKey(accessKey);
if(accessKey != " ")
{
// munge acess key into name
PRInt32 offset = Label.Find(accessKey);
if(offset != -1)
Label.Insert("_", offset);
}
char *foo = Label.ToNewCString();
g_print("%s\n", foo);
nsCRT::free(foo);
widget = nsMenuItem::CreateLocalized(Label);
gtk_widget_show(widget);
gtk_menu_bar_append (GTK_MENU_BAR (mMenuBar), widget);
aMenu->GetNativeData(&voidData);
nmenu = GTK_WIDGET(voidData);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget), nmenu);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetMenuCount(PRUint32 &aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::InsertMenuAt(const PRUint32 aCount, nsIMenu *& aMenu)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::RemoveMenu(const PRUint32 aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::RemoveAll()
{
for (int i = mMenusVoidArray.Count(); i > 0; i--) {
if(nsnull != mMenusVoidArray[i-1]) {
nsIMenu * menu = nsnull;
((nsISupports*)mMenusVoidArray[i-1])->QueryInterface(nsIMenu::GetIID(), (void**)&menu);
if(menu) {
//void * gtkmenu= nsnull;
//menu->GetNativeData(&gtkmenu);
//if(gtkmenu){
// gtk_container_remove (GTK_CONTAINER (mMenuBar), GTK_WIDGET(gtkmenu) );
//}
NS_RELEASE(menu);
g_print("menu release \n");
int num =((nsISupports*)mMenusVoidArray[i-1])->Release();
while(num) {
g_print("menu release again!\n");
num = ((nsISupports*)mMenusVoidArray[i-1])->Release();
}
}
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetNativeData(void *& aData)
{
aData = (void *)mMenuBar;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::SetNativeData(void * aData)
{
// Temporary hack for MacOS. Will go away when nsMenuBar handles it's own
// construction
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::Paint()
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// nsMenuListener interface
//
//-------------------------------------------------------------------------
nsEventStatus nsMenuBar::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuConstruct(
const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell)
{
mWebShell = (nsIWebShell*) aWebShell;
mDOMNode = (nsIDOMNode*)menubarNode;
nsIMenuBar * pnsMenuBar = nsnull;
nsresult rv = nsComponentManager::CreateInstance(kMenuBarCID,
nsnull,
nsIMenuBar::GetIID(),
(void**)&pnsMenuBar);
if (NS_OK == rv) {
if (nsnull != pnsMenuBar) {
pnsMenuBar->Create(aParentWindow);
// set pnsMenuBar as a nsMenuListener on aParentWindow
nsCOMPtr<nsIMenuListener> menuListener;
pnsMenuBar->QueryInterface(nsIMenuListener::GetIID(), getter_AddRefs(menuListener));
aParentWindow->AddMenuListener(menuListener);
nsCOMPtr<nsIDOMNode> menuNode;
((nsIDOMNode*)menubarNode)->GetFirstChild(getter_AddRefs(menuNode));
while (menuNode) {
nsCOMPtr<nsIDOMElement> menuElement(do_QueryInterface(menuNode));
if (menuElement) {
nsString menuNodeType;
nsString menuName;
nsString menuAccessKey = " ";
menuElement->GetNodeName(menuNodeType);
if (menuNodeType.Equals("menu")) {
menuElement->GetAttribute(nsAutoString("value"), menuName);
menuElement->GetAttribute(nsAutoString("accesskey"), menuAccessKey);
// Don't create the menu yet, just add in the top level names
// Create nsMenu
nsIMenu * pnsMenu = nsnull;
rv = nsComponentManager::CreateInstance(kMenuCID, nsnull, nsIMenu::GetIID(), (void**)&pnsMenu);
if (NS_OK == rv) {
// Call Create
nsISupports * supports = nsnull;
pnsMenuBar->QueryInterface(kISupportsIID, (void**) &supports);
pnsMenu->Create(supports, menuName);
NS_RELEASE(supports);
pnsMenu->SetLabel(menuName);
pnsMenu->SetAccessKey(menuAccessKey);
pnsMenu->SetDOMNode(menuNode);
pnsMenu->SetDOMElement(menuElement);
pnsMenu->SetWebShell(mWebShell);
// Make nsMenu a child of nsMenuBar
// nsMenuBar takes ownership of the nsMenu
pnsMenuBar->AddMenu(pnsMenu);
// Release the menu now that the menubar owns it
NS_RELEASE(pnsMenu);
}
}
}
nsCOMPtr<nsIDOMNode> oldmenuNode(menuNode);
oldmenuNode->GetNextSibling(getter_AddRefs(menuNode));
} // end while (nsnull != menuNode)
// Give the aParentWindow this nsMenuBar to hold onto.
// The parent window should take ownership at this point
aParentWindow->SetMenuBar(pnsMenuBar);
// HACK: force a paint for now
pnsMenuBar->Paint();
NS_RELEASE(pnsMenuBar);
} // end if ( nsnull != pnsMenuBar )
}
return nsEventStatus_eIgnore;
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}

View File

@@ -0,0 +1,85 @@
/* -*- 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 nsMenuBar_h__
#define nsMenuBar_h__
#include "nsIMenuBar.h"
#include "nsIMenuListener.h"
#include "nsVoidArray.h"
class nsIDOMNode;
class nsIWebShell;
class nsIWidget;
/**
* Native GTK+ MenuBar wrapper
*/
class nsMenuBar : public nsIMenuBar, public nsIMenuListener
{
public:
nsMenuBar();
virtual ~nsMenuBar();
// nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(
const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menuNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIWidget * aParent);
// nsIMenuBar Methods
NS_IMETHOD GetParent(nsIWidget *&aParent);
NS_IMETHOD SetParent(nsIWidget * aParent);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
NS_IMETHOD GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu);
NS_IMETHOD InsertMenuAt(const PRUint32 aCount, nsIMenu *& aMenu);
NS_IMETHOD RemoveMenu(const PRUint32 aCount);
NS_IMETHOD RemoveAll();
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD Paint();
NS_IMETHOD SetNativeData(void* aData);
protected:
GtkWidget * mMenuBar;
nsIWidget * mParent;
PRBool mIsMenuBarAdded;
nsIWebShell * mWebShell;
nsIDOMNode * mDOMNode;
nsVoidArray mMenusVoidArray;
PRUint32 mNumMenus;
};
#endif // nsMenuBar_h__

View File

@@ -0,0 +1,539 @@
/* -*- 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 <gtk/gtk.h>
#include "nsMenuItem.h"
#include "nsIMenu.h"
#include "nsIMenuBar.h"
#include "nsIWidget.h"
#include "nsGtkEventHandler.h"
#include "nsIPopUpMenu.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsIContentViewer.h"
#include "nsIDOMElement.h"
#include "nsIDocumentViewer.h"
#include "nsIPresContext.h"
#include "nsIWebShell.h"
#include "nsICharsetConverterManager.h"
#include "nsIPlatformCharset.h"
#include "nsIServiceManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsresult nsMenuItem::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(nsIMenuItem::GetIID())) {
*aInstancePtr = (void*)(nsIMenuItem*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)(nsIMenuItem*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIMenuListener::GetIID())) {
*aInstancePtr = (void*)(nsIMenuListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsMenuItem)
NS_IMPL_RELEASE(nsMenuItem)
//-------------------------------------------------------------------------
//
// nsMenuItem constructor
//
//-------------------------------------------------------------------------
nsMenuItem::nsMenuItem() : nsIMenuItem()
{
NS_INIT_REFCNT();
mMenuItem = nsnull;
mMenuParent = nsnull;
mPopUpParent = nsnull;
mTarget = nsnull;
mXULCommandListener = nsnull;
mIsSeparator = PR_FALSE;
mWebShell = nsnull;
mDOMElement = nsnull;
mIsSubMenu = PR_FALSE;
}
//-------------------------------------------------------------------------
//
// nsMenuItem destructor
//
//-------------------------------------------------------------------------
nsMenuItem::~nsMenuItem()
{
//g_print("nsMenuItem::~nsMenuItem called\n");
//NS_IF_RELEASE(mTarget);
gtk_widget_destroy(mMenuItem);
mMenuItem = nsnull;
//g_print("end nsMenuItem::~nsMenuItem\n");
}
//-------------------------------------------------------------------------
GtkWidget *nsMenuItem::GetNativeParent()
{
void * voidData;
if (nsnull != mMenuParent) {
mMenuParent->GetNativeData(&voidData);
} else if (nsnull != mPopUpParent) {
mPopUpParent->GetNativeData(voidData);
} else {
return nsnull;
}
return GTK_WIDGET(voidData);
}
//-------------------------------------------------------------------------
nsIWidget * nsMenuItem::GetMenuBarParent(nsISupports * aParent)
{
nsIWidget * widget = nsnull; // MenuBar's Parent
nsIMenu * menu = nsnull;
nsIMenuBar * menuBar = nsnull;
nsIPopUpMenu * popup = nsnull;
nsISupports * parent = aParent;
while(1) {
if (NS_OK == parent->QueryInterface(nsIMenu::GetIID(),(void**)&menu)) {
NS_RELEASE(parent);
if (NS_OK != menu->GetParent(parent)) {
NS_RELEASE(menu);
return nsnull;
}
NS_RELEASE(menu);
} else if (NS_OK == parent->QueryInterface(nsIPopUpMenu::GetIID(),(void**)&popup)) {
if (NS_OK != popup->GetParent(widget)) {
widget = nsnull;
}
NS_RELEASE(popup);
NS_RELEASE(parent);
return widget;
} else if (NS_OK == parent->QueryInterface(nsIMenuBar::GetIID(),(void**)&menuBar)) {
if (NS_OK != menuBar->GetParent(widget)) {
widget = nsnull;
}
NS_RELEASE(menuBar);
NS_RELEASE(parent);
return widget;
} else {
NS_RELEASE(parent);
return nsnull;
}
}
return nsnull;
}
GtkWidget*
nsMenuItem::CreateLocalized(const nsString& aLabel)
{
nsresult result;
static nsIUnicodeEncoder* converter = nsnull;
static int isLatin1 = 0;
static int initialized = 0;
if (!initialized) {
initialized = 1;
result = NS_ERROR_FAILURE;
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
&result);
if (platform && NS_SUCCEEDED(result)) {
nsAutoString charset("");
result = platform->GetCharset(kPlatformCharsetSel_Menu, charset);
if (NS_SUCCEEDED(result) && (charset.Length() > 0)) {
if (!charset.Compare("iso-8859-1", PR_TRUE)) {
isLatin1 = 1;
}
NS_WITH_SERVICE(nsICharsetConverterManager, manager,
NS_CHARSETCONVERTERMANAGER_PROGID, &result);
if (manager && NS_SUCCEEDED(result)) {
result = manager->GetUnicodeEncoder(&charset, &converter);
if (NS_FAILED(result) && converter) {
NS_RELEASE(converter);
converter = nsnull;
}
else if (converter) {
result = converter->SetOutputErrorBehavior(
nsIUnicodeEncoder::kOnError_Replace, nsnull, '?');
}
}
}
}
}
GtkWidget* menuItem = nsnull;
if (converter) {
char labelStr[128];
labelStr[0] = 0;
PRInt32 srcLen = aLabel.Length() + 1;
PRInt32 destLen = sizeof(labelStr);
result = converter->Convert(aLabel.GetUnicode(), &srcLen, labelStr,
&destLen);
if (labelStr[0] && NS_SUCCEEDED(result)) {
menuItem = gtk_menu_item_new_with_label(labelStr);
if (menuItem && (!isLatin1)) {
GtkWidget* label = GTK_BIN(menuItem)->child;
gtk_widget_ensure_style(label);
GtkStyle* style = gtk_style_copy(label->style);
gdk_font_unref(style->font);
style->font = gdk_fontset_load("*");
gtk_widget_set_style(label, style);
gtk_style_unref(style);
}
}
}
else {
char labelStr[128];
aLabel.ToCString(labelStr, sizeof(labelStr));
menuItem = gtk_menu_item_new_with_label(labelStr);
}
return menuItem;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator)
{
if (nsnull == aParent) {
return NS_ERROR_FAILURE;
}
if(aParent) {
nsIMenu * menu;
aParent->QueryInterface(nsIMenu::GetIID(), (void**) &menu);
mMenuParent = menu;
NS_RELEASE(menu);
}
nsIWidget *widget = nsnull; // MenuBar's Parent
nsISupports *sups;
if (NS_OK == aParent->QueryInterface(kISupportsIID,(void**)&sups)) {
widget = GetMenuBarParent(sups);
// GetMenuBarParent will call release for us
// NS_RELEASE(sups);
mTarget = widget;
}
mIsSeparator = aIsSeparator;
mLabel = aLabel;
// create the native menu item
if(mIsSeparator) {
mMenuItem = gtk_menu_item_new();
} else {
mMenuItem = CreateLocalized(aLabel);
}
gtk_widget_show(mMenuItem);
gtk_signal_connect(GTK_OBJECT(mMenuItem), "activate",
GTK_SIGNAL_FUNC(menu_item_activate_handler),
this);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetLabel(nsString &aText)
{
aText = mLabel;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetLabel(nsString &aText)
{
mLabel = aText;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetEnabled(PRBool aIsEnabled)
{
gtk_widget_set_sensitive(GTK_WIDGET(mMenuItem), aIsEnabled);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetEnabled(PRBool *aIsEnabled)
{
*aIsEnabled = GTK_WIDGET_IS_SENSITIVE(mMenuItem);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetChecked(PRBool aIsEnabled)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetChecked(PRBool *aIsEnabled)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetCheckboxType(PRBool aIsCheckbox)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetCheckboxType(PRBool *aIsCheckbox)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetCommand(PRUint32 & aCommand)
{
aCommand = mCommand;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetTarget(nsIWidget *& aTarget)
{
aTarget = mTarget;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetNativeData(void *& aData)
{
aData = (void *)mMenuItem;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::AddMenuListener(nsIMenuListener * aMenuListener)
{
NS_IF_RELEASE(mXULCommandListener);
NS_IF_ADDREF(aMenuListener);
mXULCommandListener = aMenuListener;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::RemoveMenuListener(nsIMenuListener * aMenuListener)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::IsSeparator(PRBool & aIsSep)
{
aIsSep = mIsSeparator;
return NS_OK;
}
//-------------------------------------------------------------------------
// nsIMenuListener interface
//-------------------------------------------------------------------------
nsEventStatus nsMenuItem::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
if(!mIsSeparator) {
//g_print("nsMenuItem::MenuItemSelected\n");
DoCommand();
}else{
//g_print("nsMenuItem::MenuItemSelected is separator\n");
}
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenuItem::MenuSelected(const nsMenuEvent & aMenuEvent)
{
if(mXULCommandListener)
return mXULCommandListener->MenuSelected(aMenuEvent);
//g_print("nsMenuItem::MenuSelected\n");
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenuItem::MenuDeselected(const nsMenuEvent &aMenuEvent)
{
//g_print("nsMenuItem::MenuDeselected\n");
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenuItem::MenuConstruct(const nsMenuEvent &aMenuEvent,
nsIWidget *aParentWindow,
void *menuNode,
void *aWebShell)
{
//g_print("nsMenuItem::MenuConstruct\n");
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
nsEventStatus nsMenuItem::MenuDestruct(const nsMenuEvent &aMenuEvent)
{
//g_print("nsMenuItem::MenuDestruct\n");
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
/**
* 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_METHOD nsMenuItem::SetCommand(const nsString &aStrCmd)
{
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* Executes the "cached" JavaScript Command
* @return NS_OK if the command was executed properly, otherwise an error code
*/
NS_METHOD nsMenuItem::DoCommand()
{
nsresult rv = NS_ERROR_FAILURE;
if(!mWebShell || !mDOMElement)
return rv;
nsCOMPtr<nsIContentViewer> contentViewer;
NS_ENSURE_SUCCESS(mWebShell->GetContentViewer(getter_AddRefs(contentViewer)),
NS_ERROR_FAILURE);
nsCOMPtr<nsIDocumentViewer> docViewer;
docViewer = do_QueryInterface(contentViewer);
if (!docViewer) {
NS_ERROR("Document viewer interface not supported by the content viewer.");
//g_print("Document viewer interface not supported by the content viewer.");
return rv;
}
nsCOMPtr<nsIPresContext> presContext;
if (NS_FAILED(rv = docViewer->GetPresContext(*getter_AddRefs(presContext)))) {
NS_ERROR("Unable to retrieve the doc viewer's presentation context.");
//g_print("Unable to retrieve the doc viewer's presentation context.");
return rv;
}
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event;
event.eventStructType = NS_MOUSE_EVENT;
event.message = NS_MENU_ACTION;
nsCOMPtr<nsIContent> contentNode;
contentNode = do_QueryInterface(mDOMElement);
if (!contentNode) {
NS_ERROR("DOM Node doesn't support the nsIContent interface required to handle DOM events.");
//g_print("DOM Node doesn't support the nsIContent interface required to handle DOM events.");
return rv;
}
rv = contentNode->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status);
//g_print("HandleDOMEvent called");
return rv;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetDOMNode(nsIDOMNode * aDOMNode)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetDOMNode(nsIDOMNode ** aDOMNode)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetDOMElement(nsIDOMElement * aDOMElement)
{
mDOMElement = aDOMElement;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetDOMElement(nsIDOMElement ** aDOMElement)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::SetWebShell(nsIWebShell * aWebShell)
{
mWebShell = aWebShell;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::SetShortcutChar(const nsString &aText)
{
mKeyEquivalent = aText;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::GetShortcutChar(nsString &aText)
{
aText = mKeyEquivalent;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::SetModifiers(PRUint8 aModifiers)
{
mModifiers = aModifiers;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::GetModifiers(PRUint8 * aModifiers)
{
*aModifiers = mModifiers;
return NS_OK;
}

View File

@@ -0,0 +1,116 @@
/* -*- 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 nsMenuItem_h__
#define nsMenuItem_h__
#include "nsIMenuItem.h"
#include "nsString.h"
#include "nsIMenuListener.h"
class nsIDOMNode;
class nsIDOMElement;
class nsIMenu;
class nsIPopUpMenu;
class nsIWebShell;
class nsIWidget;
/**
* Native GTK+ MenuItem wrapper
*/
class nsMenuItem : public nsIMenuItem, public nsIMenuListener
{
public:
nsMenuItem();
virtual ~nsMenuItem();
// nsISupports
NS_DECL_ISUPPORTS
// nsIMenuItem Methods
NS_IMETHOD Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator);
NS_IMETHOD GetLabel(nsString &aText);
NS_IMETHOD SetLabel(nsString &aText);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
NS_IMETHOD GetEnabled(PRBool *aIsEnabled);
NS_IMETHOD SetChecked(PRBool aIsEnabled);
NS_IMETHOD GetChecked(PRBool *aIsEnabled);
NS_IMETHOD SetCheckboxType(PRBool aIsCheckbox);
NS_IMETHOD GetCheckboxType(PRBool *aIsCheckbox);
NS_IMETHOD GetCommand(PRUint32 & aCommand);
NS_IMETHOD GetTarget(nsIWidget *& aTarget);
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD IsSeparator(PRBool & aIsSep);
NS_IMETHOD SetCommand(const nsString & aStrCmd);
NS_IMETHOD DoCommand();
NS_IMETHOD SetDOMNode(nsIDOMNode * aDOMNode);
NS_IMETHOD GetDOMNode(nsIDOMNode ** aDOMNode);
NS_IMETHOD SetDOMElement(nsIDOMElement * aDOMElement);
NS_IMETHOD GetDOMElement(nsIDOMElement ** aDOMElement);
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell);
NS_IMETHOD SetShortcutChar(const nsString &aText);
NS_IMETHOD GetShortcutChar(nsString &aText);
NS_IMETHOD SetModifiers(PRUint8 aModifiers);
NS_IMETHOD GetModifiers(PRUint8 * aModifiers);
// nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menuNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
static GtkWidget* CreateLocalized(const nsString& aLabel);
protected:
nsIWidget *GetMenuBarParent(nsISupports * aParentSupports);
GtkWidget *GetNativeParent();
nsIMenuListener *mXULCommandListener;
nsString mLabel;
nsString mKeyEquivalent;
PRUint8 mModifiers;
PRUint32 mCommand;
nsIMenu *mMenuParent;
nsIPopUpMenu *mPopUpParent;
nsIWidget *mTarget;
GtkWidget *mMenuItem; // native cascade widget
PRBool mIsSeparator;
PRBool mIsSubMenu;
nsIWebShell * mWebShell;
nsIDOMElement * mDOMElement;
};
#endif // nsMenuItem_h__

View File

@@ -0,0 +1,214 @@
/* -*- 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 "nsPopUpMenu.h"
#include "nsIMenu.h"
#include "nsIWidget.h"
#include "nsString.h"
#include "nsFileSpec.h" // XXX: For nsAutoCString
NS_IMPL_ISUPPORTS(nsPopUpMenu, nsIPopUpMenu::GetIID())
//-------------------------------------------------------------------------
//
// nsPopUpMenu constructor
//
//-------------------------------------------------------------------------
nsPopUpMenu::nsPopUpMenu() : nsIPopUpMenu()
{
NS_INIT_REFCNT();
mNumMenuItems = 0;
mParent = nsnull;
mMenu = nsnull;
}
//-------------------------------------------------------------------------
//
// nsPopUpMenu destructor
//
//-------------------------------------------------------------------------
nsPopUpMenu::~nsPopUpMenu()
{
NS_IF_RELEASE(mParent);
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::Create(nsIWidget *aParent)
{
mParent = aParent;
NS_ADDREF(mParent);
mMenu = gtk_menu_new();
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::AddItem(const nsString &aText)
{
GtkWidget *widget;
widget = gtk_menu_item_new_with_label ((const char*)nsAutoCString(mLabel));
gtk_widget_show(widget);
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::AddItem(nsIMenuItem * aMenuItem)
{
GtkWidget *widget;
void *voidData;
aMenuItem->GetNativeData(voidData);
widget = GTK_WIDGET(voidData);
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
// XXX add aMenuItem to internal data structor list
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::AddMenu(nsIMenu * aMenu)
{
nsString Label;
GtkWidget *item=NULL, *parentmenu=NULL, *newmenu=NULL;
void *voidData=NULL;
aMenu->GetLabel(Label);
GetNativeData(voidData);
parentmenu = GTK_WIDGET(voidData);
item = gtk_menu_item_new_with_label ((const char*)nsAutoCString(Label));
gtk_widget_show(item);
gtk_menu_shell_append (GTK_MENU_SHELL (parentmenu), item);
voidData = NULL;
aMenu->GetNativeData(&voidData);
newmenu = GTK_WIDGET(voidData);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), newmenu);
// XXX add aMenu to internal data structor list
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::AddSeparator()
{
GtkWidget *widget;
widget = gtk_menu_item_new ();
gtk_widget_show(widget);
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::GetItemCount(PRUint32 &aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::GetItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::InsertItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::InsertItemAt(const PRUint32 aCount, const nsString & aMenuItemName)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::InsertSeparator(const PRUint32 aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::RemoveItem(const PRUint32 aCount)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::RemoveAll()
{
return NS_OK;
}
//-------------------------------------------------------------------------
void nsPopUpMenu::GetXY(GtkMenu *menu, gint *x, gint *y, gpointer user_data)
{
*x = ((nsPopUpMenu *)(user_data))->mX;
*y = ((nsPopUpMenu *)(user_data))->mY;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::ShowMenu(PRInt32 aX, PRInt32 aY)
{
mX = aX;
mY = aY;
gtk_menu_popup (GTK_MENU(mMenu),
NULL,
NULL,
GetXY,
this,
0,
GDK_CURRENT_TIME);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::GetNativeData(void *& aData)
{
aData = (void *)mMenu;
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsPopUpMenu::GetParent(nsIWidget *& aParent)
{
aParent = mParent;
return NS_OK;
}

View File

@@ -0,0 +1,77 @@
/* -*- 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 nsPopUpMenu_h__
#define nsPopUpMenu_h__
#include "nsIPopUpMenu.h"
#include <gtk/gtk.h>
class nsIWidget;
/**
* Native GTK+ PopUp wrapper
*/
class nsPopUpMenu : public nsIPopUpMenu
{
public:
nsPopUpMenu();
virtual ~nsPopUpMenu();
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIWidget * aParent);
// nsIPopUpMenu Methods
NS_IMETHOD AddItem(const nsString &aText);
NS_IMETHOD AddItem(nsIMenuItem * aMenuItem);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD AddSeparator();
NS_IMETHOD GetItemCount(PRUint32 &aCount);
NS_IMETHOD GetItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aCount, const nsString & aMenuItemName);
NS_IMETHOD InsertSeparator(const PRUint32 aCount);
NS_IMETHOD RemoveItem(const PRUint32 aCount);
NS_IMETHOD RemoveAll();
static void GetXY(GtkMenu *menu, gint *x, gint *y, gpointer user_data);
NS_IMETHOD ShowMenu(PRInt32 aX, PRInt32 aY);
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD GetParent(nsIWidget*& aParent);
protected:
nsString mLabel;
PRUint32 mNumMenuItems;
nsIWidget *mParent;
GtkWidget *mMenu;
gint mX;
gint mY;
};
#endif // nsPopUpMenu_h__

View File

@@ -0,0 +1,240 @@
/* -*- 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 <gtk/gtk.h>
#include "nsRadioButton.h"
#include "nsString.h"
#include "nsGtkEventHandler.h"
NS_IMPL_ADDREF_INHERITED(nsRadioButton, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsRadioButton, nsWidget)
//-------------------------------------------------------------------------
//
// nsRadioButton constructor
//
//-------------------------------------------------------------------------
nsRadioButton::nsRadioButton() : nsWidget(), nsIRadioButton()
{
NS_INIT_REFCNT();
mLabel = nsnull;
mRadioButton = nsnull;
}
//-------------------------------------------------------------------------
//
// nsRadioButton destructor
//
//-------------------------------------------------------------------------
nsRadioButton::~nsRadioButton()
{
#if 0
if (mLabel)
gtk_widget_destroy(mLabel);
#endif
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsRadioButton::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWidget::QueryInterface(aIID, aInstancePtr);
if (result == NS_NOINTERFACE && aIID.Equals(nsIRadioButton::GetIID())) {
*aInstancePtr = (void*) ((nsIRadioButton*)this);
AddRef();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// Create the native RadioButton widget
//
//-------------------------------------------------------------------------
NS_METHOD nsRadioButton::CreateNative(GtkObject *parentWindow)
{
mWidget = gtk_event_box_new();
mRadioButton = gtk_radio_button_new(nsnull);
gtk_container_add(GTK_CONTAINER(mWidget), mRadioButton);
gtk_widget_show(mRadioButton);
gtk_widget_set_name(mWidget, "nsRadioButton");
gtk_radio_button_set_group(GTK_RADIO_BUTTON(mRadioButton), nsnull);
gtk_signal_connect(GTK_OBJECT(mRadioButton),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
return NS_OK;
}
void
nsRadioButton::OnDestroySignal(GtkWidget* aGtkWidget)
{
if (aGtkWidget == mLabel) {
mLabel = nsnull;
}
else if (aGtkWidget == mRadioButton) {
mRadioButton = nsnull;
}
else {
nsWidget::OnDestroySignal(aGtkWidget);
}
}
void nsRadioButton::InitCallbacks(char * aName)
{
InstallButtonPressSignal(mRadioButton);
InstallButtonReleaseSignal(mRadioButton);
InstallEnterNotifySignal(mWidget);
InstallLeaveNotifySignal(mWidget);
// These are needed so that the events will go to us and not our parent.
AddToEventMask(mWidget,
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsRadioButton::SetState(const PRBool aState)
{
if (mWidget) {
GtkToggleButton * item = GTK_TOGGLE_BUTTON(mRadioButton);
item->active = (gboolean) aState;
gtk_widget_queue_draw(GTK_WIDGET(item));
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button state
//-------------------------------------------------------------------------
NS_METHOD nsRadioButton::GetState(PRBool& aState)
{
if (mWidget) {
aState = (PRBool) GTK_TOGGLE_BUTTON(mRadioButton)->active;
}
else {
aState = PR_TRUE;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsRadioButton::SetLabel(const nsString& aText)
{
if (mWidget) {
NS_ALLOC_STR_BUF(label, aText, 256);
g_print("nsRadioButton::SetLabel(%s)\n",label);
if (mLabel) {
gtk_label_set(GTK_LABEL(mLabel), label);
} else {
mLabel = gtk_label_new(label);
gtk_misc_set_alignment (GTK_MISC (mLabel), 0.0, 0.5);
gtk_container_add(GTK_CONTAINER(mRadioButton), mLabel);
gtk_widget_show(mLabel); /* XXX */
gtk_signal_connect(GTK_OBJECT(mLabel),
"destroy",
GTK_SIGNAL_FUNC(DestroySignal),
this);
}
NS_FREE_STR_BUF(label);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this button label
//
//-------------------------------------------------------------------------
NS_METHOD nsRadioButton::GetLabel(nsString& aBuffer)
{
aBuffer.Truncate();
if (mWidget) {
if (mLabel) {
char* text;
gtk_label_get(GTK_LABEL(mLabel), &text);
aBuffer.Append(text);
}
}
return NS_OK;
}
//////////////////////////////////////////////////////////////////////
// SetBackgroundColor for RadioButton
/*virtual*/
void nsRadioButton::SetBackgroundColorNative(GdkColor *aColorNor,
GdkColor *aColorBri,
GdkColor *aColorDark)
{
// use same style copy as SetFont
GtkStyle *style = gtk_style_copy(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0))->style);
style->bg[GTK_STATE_NORMAL]=*aColorNor;
// Mouse over button
style->bg[GTK_STATE_PRELIGHT]=*aColorBri;
// Button is down
style->bg[GTK_STATE_ACTIVE]=*aColorDark;
// other states too? (GTK_STATE_ACTIVE, GTK_STATE_PRELIGHT,
// GTK_STATE_SELECTED, GTK_STATE_INSENSITIVE)
gtk_widget_set_style(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0)), style);
// set style for eventbox too
gtk_widget_set_style(mWidget, style);
gtk_style_unref(style);
}

View File

@@ -0,0 +1,75 @@
/* -*- 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 nsRadioButton_h__
#define nsRadioButton_h__
#include "nsWidget.h"
#include "nsIRadioButton.h"
/**
* Native GTK+ Radiobutton wrapper
*/
class nsRadioButton : public nsWidget,
public nsIRadioButton
{
public:
nsRadioButton();
virtual ~nsRadioButton();
// nsISupports
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
// nsIRadioButton part
NS_IMETHOD SetLabel(const nsString& aText);
NS_IMETHOD GetLabel(nsString& aBuffer);
NS_IMETHOD SetState(const PRBool aState);
NS_IMETHOD GetState(PRBool& aState);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY) { return PR_FALSE; }
virtual PRBool OnPaint(nsPaintEvent & aEvent) { return PR_FALSE; }
virtual PRBool OnResize(nsRect &aRect) { return PR_FALSE; }
// These are needed to Override the auto check behavior
void Armed();
void DisArmed();
protected:
NS_IMETHOD CreateNative(GtkObject *parentWindow);
virtual void InitCallbacks(char * aName = nsnull);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
// Sets background for checkbutton
virtual void SetBackgroundColorNative(GdkColor *aColorNor,
GdkColor *aColorBri,
GdkColor *aColorDark);
GtkWidget *mLabel;
GtkWidget *mRadioButton;
};
#endif // nsRadioButton_h__

View File

@@ -0,0 +1,455 @@
/* -*- 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 <gtk/gtk.h>
#include "nsScrollbar.h"
#include "nsGUIEvent.h"
#include "nsGtkEventHandler.h"
NS_IMPL_ADDREF_INHERITED(nsScrollbar, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsScrollbar, nsWidget)
NS_IMPL_QUERY_INTERFACE2(nsScrollbar, nsIScrollbar, nsIWidget)
//-------------------------------------------------------------------------
//
// nsScrollbar constructor
//
//-------------------------------------------------------------------------
nsScrollbar::nsScrollbar (PRBool aIsVertical):nsWidget (), nsIScrollbar ()
{
NS_INIT_REFCNT ();
mOrientation = (aIsVertical) ?
GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL;
}
//-------------------------------------------------------------------------
//
// nsScrollbar destructor
//
//-------------------------------------------------------------------------
nsScrollbar::~nsScrollbar ()
{
}
//-------------------------------------------------------------------------
//
// Create the native scrollbar widget
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::CreateNative (GtkObject * parentWindow)
{
// Create scrollbar, random default values
mAdjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 25, 25));
#ifdef USE_SUPERWIN
if (!GDK_IS_SUPERWIN(parentWindow)) {
g_print("Damn, brother. That's not a superwin.\n");
return NS_ERROR_FAILURE;
}
GdkSuperWin *superwin = GDK_SUPERWIN(parentWindow);
mMozBox = gtk_mozbox_new(superwin->bin_window);
#endif /* USE_SUPERWIN */
switch (mOrientation)
{
case GTK_ORIENTATION_HORIZONTAL:
mWidget = gtk_hscrollbar_new (mAdjustment);
break;
case GTK_ORIENTATION_VERTICAL:
mWidget = gtk_vscrollbar_new (mAdjustment);
break;
}
#ifdef USE_SUPERWIN
// make sure that we put the scrollbar into the mozbox
gtk_container_add(GTK_CONTAINER(mMozBox), mWidget);
#endif /* USE_SUPERWIN */
gtk_widget_set_name (mWidget, "nsScrollbar");
gtk_signal_connect (GTK_OBJECT (mAdjustment),
"value_changed",
GTK_SIGNAL_FUNC (handle_scrollbar_value_changed),
this);
gtk_signal_connect (GTK_OBJECT (mAdjustment),
"destroy",
GTK_SIGNAL_FUNC (DestroySignal),
this);
return NS_OK;
}
void
nsScrollbar::OnDestroySignal(GtkWidget* aGtkWidget)
{
if ((void*)aGtkWidget == (void*)mAdjustment) {
mAdjustment = nsnull;
}
else {
nsWidget::OnDestroySignal(aGtkWidget);
}
}
//-------------------------------------------------------------------------
//
// Define the range settings
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::SetMaxRange (PRUint32 aEndRange)
{
if (mAdjustment) {
GTK_ADJUSTMENT (mAdjustment)->upper = (float) aEndRange;
gtk_signal_emit_by_name (GTK_OBJECT (mAdjustment), "changed");
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Return the range settings
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::GetMaxRange (PRUint32 & aMaxRange)
{
if (mAdjustment)
aMaxRange = (PRUint32) GTK_ADJUSTMENT (mAdjustment)->upper;
else
aMaxRange = 0;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the thumb position
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::SetPosition (PRUint32 aPos)
{
// if (mAdjustment)
// gtk_adjustment_set_value (GTK_ADJUSTMENT (mAdjustment), (float) aPos);
if (mAdjustment && mWidget)
{
//
// The following bit of code borrowed from gtkrange.c,
// gtk_range_adjustment_value_changed():
//
// Ok, so, like, the problem is that the view manager expects
// SetPosition() to simply do that - set the position of the
// scroll bar. Nothing else!
//
// Unfortunately, calling gtk_adjustment_set_value() causes
// the adjustment object (mAdjustment) to emit a
// "value_changed" signal which in turn causes the
// scrollbar widget (mWidget) to scroll to the given position.
//
// The net result of this is that the content is scrolled
// twice, once by the view manager and once by the
// scrollbar - and things get messed up from then onwards.
//
// The following bit of code does the equivalent of
// gtk_adjustment_set_value(), except no signal is emitted.
//
GtkRange * range = GTK_RANGE(mWidget);
GtkAdjustment * adjustment = GTK_ADJUSTMENT(mAdjustment);
adjustment->value = (float) aPos;
if (range->old_value != adjustment->value)
{
gtk_range_slider_update (range);
gtk_range_clear_background (range);
range->old_value = adjustment->value;
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the current thumb position.
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::GetPosition (PRUint32 & aPos)
{
if (mAdjustment)
aPos = (PRUint32) GTK_ADJUSTMENT (mAdjustment)->value;
else
aPos = 0;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the thumb size
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::SetThumbSize (PRUint32 aSize)
{
if (aSize > 0)
{
if (mAdjustment) {
GTK_ADJUSTMENT (mAdjustment)->page_increment = (float) aSize;
GTK_ADJUSTMENT (mAdjustment)->page_size = (float) aSize;
gtk_signal_emit_by_name (GTK_OBJECT (mAdjustment), "changed");
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the thumb size
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::GetThumbSize (PRUint32 & aThumbSize)
{
if (mAdjustment)
aThumbSize = (PRUint32) GTK_ADJUSTMENT (mAdjustment)->page_size;
else
aThumbSize = 0;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the line increment for this scrollbar
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::SetLineIncrement (PRUint32 aLineIncrement)
{
if (aLineIncrement > 0)
{
if (mAdjustment) {
GTK_ADJUSTMENT (mAdjustment)->step_increment = (float) aLineIncrement;
gtk_signal_emit_by_name (GTK_OBJECT (mAdjustment), "changed");
}
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the line increment for this scrollbar
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::GetLineIncrement (PRUint32 & aLineInc)
{
if (mAdjustment) {
aLineInc = (PRUint32) GTK_ADJUSTMENT (mAdjustment)->step_increment;
}
else
aLineInc = 0;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set all scrolling parameters
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsScrollbar::SetParameters (PRUint32 aMaxRange, PRUint32 aThumbSize,
PRUint32 aPosition, PRUint32 aLineIncrement)
{
if (mAdjustment) {
int thumbSize = (((int) aThumbSize) > 0 ? aThumbSize : 1);
int maxRange = (((int) aMaxRange) > 0 ? aMaxRange : 10);
int mLineIncrement = (((int) aLineIncrement) > 0 ? aLineIncrement : 1);
int maxPos = maxRange - thumbSize;
int pos = ((int) aPosition) > maxPos ? maxPos - 1 : ((int) aPosition);
GTK_ADJUSTMENT (mAdjustment)->lower = 0;
GTK_ADJUSTMENT (mAdjustment)->upper = maxRange;
GTK_ADJUSTMENT (mAdjustment)->page_size = thumbSize;
GTK_ADJUSTMENT (mAdjustment)->page_increment = thumbSize;
GTK_ADJUSTMENT (mAdjustment)->step_increment = mLineIncrement;
// this will emit the changed signal for us
gtk_adjustment_set_value (GTK_ADJUSTMENT (mAdjustment), pos);
}
return NS_OK;
}
//-------------------------------------------------------------------------
int nsScrollbar::AdjustScrollBarPosition (int aPosition)
{
return 0; /* XXX */
}
//-------------------------------------------------------------------------
//
// Deal with scrollbar messages (actually implemented only in nsScrollbar)
//
//-------------------------------------------------------------------------
PRBool nsScrollbar::OnScroll (nsScrollbarEvent & aEvent, PRUint32 cPos)
{
PRBool result = PR_TRUE;
float newPosition;
switch (aEvent.message)
{
// scroll one line right or down
case NS_SCROLLBAR_LINE_NEXT:
{
newPosition = GTK_ADJUSTMENT (mAdjustment)->value;
// newPosition += mLineIncrement;
newPosition += 10;
PRUint32 thumbSize;
PRUint32 maxRange;
GetThumbSize (thumbSize);
GetMaxRange (maxRange);
PRUint32 max = maxRange - thumbSize;
if (newPosition > (int) max)
newPosition = (int) max;
// if an event callback is registered, give it the chance
// to change the increment
if (mEventCallback)
{
aEvent.position = (PRUint32) newPosition;
result = ConvertStatus ((*mEventCallback) (&aEvent));
newPosition = aEvent.position;
}
break;
}
// scroll one line left or up
case NS_SCROLLBAR_LINE_PREV:
{
newPosition = GTK_ADJUSTMENT (mAdjustment)->value;
// newPosition -= mLineIncrement;
newPosition -= 10;
if (newPosition < 0)
newPosition = 0;
// if an event callback is registered, give it the chance
// to change the decrement
if (mEventCallback)
{
aEvent.position = (PRUint32) newPosition;
aEvent.widget = (nsWidget *) this;
result = ConvertStatus ((*mEventCallback) (&aEvent));
newPosition = aEvent.position;
}
break;
}
// Scrolls one page right or down
case NS_SCROLLBAR_PAGE_NEXT:
{
newPosition = GTK_ADJUSTMENT (mAdjustment)->value;
PRUint32 thumbSize;
GetThumbSize (thumbSize);
PRUint32 maxRange;
GetThumbSize (thumbSize);
GetMaxRange (maxRange);
PRUint32 max = maxRange - thumbSize;
if (newPosition > (int) max)
newPosition = (int) max;
// if an event callback is registered, give it the chance
// to change the increment
if (mEventCallback)
{
aEvent.position = (PRUint32) newPosition;
result = ConvertStatus ((*mEventCallback) (&aEvent));
newPosition = aEvent.position;
}
break;
}
// Scrolls one page left or up.
case NS_SCROLLBAR_PAGE_PREV:
{
newPosition = GTK_ADJUSTMENT (mAdjustment)->value;
if (newPosition < 0)
newPosition = 0;
// if an event callback is registered, give it the chance
// to change the increment
if (mEventCallback)
{
aEvent.position = (PRUint32) newPosition;
result = ConvertStatus ((*mEventCallback) (&aEvent));
newPosition = aEvent.position;
}
break;
}
// Scrolls to the absolute position. The current position is specified by
// the cPos parameter.
case NS_SCROLLBAR_POS:
{
newPosition = cPos;
// if an event callback is registered, give it the chance
// to change the increment
if (mEventCallback)
{
aEvent.position = (PRUint32) newPosition;
result = ConvertStatus ((*mEventCallback) (&aEvent));
newPosition = aEvent.position;
}
break;
}
}
/*
GTK_ADJUSTMENT(mAdjustment)->value = newPosition;
gtk_signal_emit_by_name(GTK_OBJECT(mAdjustment), "value_changed");
*/
/*
if (mEventCallback) {
aEvent.position = cPos;
result = ConvertStatus((*mEventCallback)(&aEvent));
newPosition = aEvent.position;
}
*/
return result;
}

View File

@@ -0,0 +1,66 @@
/* -*- 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 nsScrollbar_h__
#define nsScrollbar_h__
#include "nsWidget.h"
#include "nsIScrollbar.h"
/**
* Native GTK+ scrollbar wrapper.
*/
class nsScrollbar : public nsWidget,
public nsIScrollbar
{
public:
nsScrollbar(PRBool aIsVertical);
virtual ~nsScrollbar();
NS_DECL_ISUPPORTS_INHERITED
// nsIScrollBar implementation
NS_IMETHOD SetMaxRange(PRUint32 aEndRange);
NS_IMETHOD GetMaxRange(PRUint32& aMaxRange);
NS_IMETHOD SetPosition(PRUint32 aPos);
NS_IMETHOD GetPosition(PRUint32& aPos);
NS_IMETHOD SetThumbSize(PRUint32 aSize);
NS_IMETHOD GetThumbSize(PRUint32& aSize);
NS_IMETHOD SetLineIncrement(PRUint32 aSize);
NS_IMETHOD GetLineIncrement(PRUint32& aSize);
NS_IMETHOD SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize,
PRUint32 aPosition, PRUint32 aLineIncrement);
virtual PRBool OnScroll (nsScrollbarEvent & aEvent, PRUint32 cPos);
protected:
NS_IMETHOD CreateNative(GtkObject *parentWindow);
virtual void OnDestroySignal(GtkWidget* aGtkWidget);
private:
int mOrientation;
GtkAdjustment *mAdjustment;
int AdjustScrollBarPosition(int aPosition);
};
#endif /* nsScrollbar_h__ */

View File

@@ -0,0 +1,125 @@
/* -*- 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 "nscore.h"
#include "nsIAllocator.h"
#include "plstr.h"
#include "stdio.h"
#include "prlink.h"
#include "nsSound.h"
#include <unistd.h>
#include <gtk/gtk.h>
/* used with esd_open_sound */
//static int esdref = -1;
static PRLibrary *lib = nsnull;
//typedef int (PR_CALLBACK *EsdOpenSoundType)(const char *host);
//typedef int (PR_CALLBACK *EsdCloseType)(int);
/* used to play the sounds from the find symbol call */
typedef int (PR_CALLBACK *EsdPlayFileType)(const char *, const char *, int);
NS_IMPL_ISUPPORTS1(nsSound, nsISound);
////////////////////////////////////////////////////////////////////////
nsSound::nsSound()
{
NS_INIT_REFCNT();
/* we don't need to do esd_open_sound if we are only going to play files
but we will if we want to do things like streams, etc
*/
// EsdOpenSoundType EsdOpenSound;
lib = PR_LoadLibrary("libesd.so");
/*
if (!lib)
return;
EsdOpenSound = (EsdOpenSoundType) PR_FindSymbol(lib, "esd_open_sound");
esdref = (*EsdOpenSound)("localhost");
*/
}
nsSound::~nsSound()
{
/* see above comment */
/*
if (esdref != -1)
{
EsdCloseType EsdClose = (EsdCloseType) PR_FindSymbol(lib, "esd_close");
(*EsdClose)(esdref);
esdref = -1;
}
*/
}
nsresult NS_NewSound(nsISound** aSound)
{
NS_PRECONDITION(aSound != nsnull, "null ptr");
if (! aSound)
return NS_ERROR_NULL_POINTER;
*aSound = new nsSound();
if (! *aSound)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*aSound);
return NS_OK;
}
NS_METHOD nsSound::Init(void)
{
return NS_OK;
}
NS_METHOD nsSound::Beep()
{
::gdk_beep();
return NS_OK;
}
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
{
if (lib)
{
char *filename;
filespec->GetNativePath(&filename);
g_print("there are some issues with playing sound right now, but this should work\n");
EsdPlayFileType EsdPlayFile = (EsdPlayFileType) PR_FindSymbol(lib, "esd_play_file");
(*EsdPlayFile)("mozilla", filename, 1);
nsCRT::free(filename);
return NS_OK;
}
return NS_OK;
}

View File

@@ -0,0 +1,41 @@
/* -*- 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 __nsSound_h__
#define __nsSound_h__
#include "nsISound.h"
#include <gtk/gtk.h>
class nsSound : public nsISound {
public:
nsSound();
virtual ~nsSound();
NS_DECL_ISUPPORTS
NS_DECL_NSISOUND
};
#endif /* __nsSound_h__ */

View File

@@ -0,0 +1,97 @@
/* -*- 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 <gtk/gtk.h>
#include "nsTextAreaWidget.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsTextAreaWidget, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsTextAreaWidget, nsWidget)
NS_IMPL_QUERY_INTERFACE2(nsTextAreaWidget, nsITextAreaWidget, nsIWidget)
//-------------------------------------------------------------------------
//
// nsTextAreaWidget constructor
//
//-------------------------------------------------------------------------
nsTextAreaWidget::nsTextAreaWidget()
{
mBackground = NS_RGB(124, 124, 124);
}
//-------------------------------------------------------------------------
//
// nsTextAreaWidget destructor
//
//-------------------------------------------------------------------------
nsTextAreaWidget::~nsTextAreaWidget()
{
gtk_widget_destroy(mTextWidget);
mTextWidget = nsnull;
}
//-------------------------------------------------------------------------
//
// Create the native Text widget
//
//-------------------------------------------------------------------------
NS_METHOD nsTextAreaWidget::CreateNative(GtkObject *parentWindow)
{
PRBool oldIsReadOnly;
mWidget = gtk_scrolled_window_new(nsnull, nsnull);
gtk_container_set_border_width(GTK_CONTAINER(mWidget), 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(mWidget),
GTK_POLICY_NEVER,
GTK_POLICY_ALWAYS);
mTextWidget = gtk_text_new(nsnull, nsnull);
gtk_text_set_word_wrap(GTK_TEXT(mTextWidget), PR_TRUE);
gtk_widget_set_name(mTextWidget, "nsTextAreaWidget");
gtk_widget_show(mTextWidget);
SetPassword(mIsPassword);
SetReadOnly(mIsReadOnly, oldIsReadOnly);
gtk_container_add(GTK_CONTAINER(mWidget), mTextWidget);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// set font for textarea
//
//-------------------------------------------------------------------------
/* virtual */
void nsTextAreaWidget::SetFontNative(GdkFont *aFont)
{
GtkStyle *style = gtk_style_copy(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0))->style);
// gtk_style_copy ups the ref count of the font
gdk_font_unref (style->font);
style->font = aFont;
gdk_font_ref(style->font);
gtk_widget_set_style(GTK_WIDGET (g_list_nth_data(gtk_container_children(GTK_CONTAINER (mWidget)),0)), style);
gtk_style_unref(style);
}

View File

@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- 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
@@ -20,23 +20,30 @@
* Contributor(s):
*/
#include "nsINetDataCache.idl"
#ifndef nsTextAreaWidget_h__
#define nsTextAreaWidget_h__
interface nsIFileSpec;
#include "nsTextHelper.h"
#include "nsITextAreaWidget.h"
/**
/**
* A network-data disk cache is used to persistently cache the responses to
* network retrieval commands. Each cache entry may contain both content,
* e.g. GIF image data, and associated metadata, e.g. HTTP headers.
* Native GTK+ multi-line edit control wrapper.
*/
[scriptable, uuid(6408e390-6f13-11d3-90c8-000064657374)]
interface nsINetDataDiskCache : nsINetDataCache
class nsTextAreaWidget : public nsTextHelper
{
/**
* This attribute must be set before calling any other methods of this
* interface.
*/
attribute nsIFileSpec diskCacheFolder;
public:
nsTextAreaWidget();
virtual ~nsTextAreaWidget();
NS_DECL_ISUPPORTS_INHERITED
virtual void SetFontNative(GdkFont *aFont);
protected:
NS_METHOD CreateNative(GtkObject *parentWindow);
};
#endif // nsTextAreaWidget_h__

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