mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 06:45:33 +00:00
Bug 120026 - rework PPEmbed so its classes are less dependent and more easily reusable. r=adamlock@netscape.com/sr=sfraser@netscape.com
This commit is contained in:
parent
b9c06e75b3
commit
e34bc87b67
@ -95,6 +95,16 @@
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>::::themes:classic:communicator:brand:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>SystemSearchPaths</NAME>
|
||||
<SETTING>
|
||||
@ -1067,7 +1077,7 @@
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
@ -1086,6 +1096,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>UMacUnicode.cpp</PATH>
|
||||
@ -1184,6 +1201,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -1247,6 +1271,13 @@
|
||||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>QuickTimeLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS>Debug, WeakImport</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CarbonAccessors.o</PATH>
|
||||
@ -1272,7 +1303,7 @@
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
@ -1280,6 +1311,11 @@
|
||||
<PATH>CBrowserShell.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CBrowserWindow.cp</PATH>
|
||||
@ -1435,6 +1471,11 @@
|
||||
<PATH>ContextMenus.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -1470,6 +1511,11 @@
|
||||
<PATH>IconServicesLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>QuickTimeLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CarbonAccessors.o</PATH>
|
||||
@ -1529,6 +1575,16 @@
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>::::themes:classic:communicator:brand:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>SystemSearchPaths</NAME>
|
||||
<SETTING>
|
||||
@ -2484,7 +2540,7 @@
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
@ -2503,6 +2559,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>UMacUnicode.cpp</PATH>
|
||||
@ -2608,6 +2671,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -2671,6 +2741,13 @@
|
||||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>QuickTimeLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS>Debug, WeakImport</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CarbonAccessors.o</PATH>
|
||||
@ -2696,7 +2773,7 @@
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
@ -2704,6 +2781,11 @@
|
||||
<PATH>CBrowserShell.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CBrowserWindow.cp</PATH>
|
||||
@ -2849,6 +2931,11 @@
|
||||
<PATH>ContextMenus.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -2894,6 +2981,11 @@
|
||||
<PATH>IconServicesLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>QuickTimeLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CarbonAccessors.o</PATH>
|
||||
@ -2953,6 +3045,16 @@
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>::::themes:classic:communicator:brand:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>SystemSearchPaths</NAME>
|
||||
<SETTING>
|
||||
@ -3873,7 +3975,7 @@
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
@ -3892,6 +3994,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>UMacUnicode.cpp</PATH>
|
||||
@ -3976,6 +4085,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -4064,7 +4180,7 @@
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
@ -4072,6 +4188,11 @@
|
||||
<PATH>CBrowserShell.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CBrowserWindow.cp</PATH>
|
||||
@ -4192,6 +4313,11 @@
|
||||
<PATH>ContextMenus.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -4281,6 +4407,16 @@
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>::::themes:classic:communicator:brand:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>SystemSearchPaths</NAME>
|
||||
<SETTING>
|
||||
@ -5194,7 +5330,7 @@
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
@ -5213,6 +5349,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>UMacUnicode.cpp</PATH>
|
||||
@ -5304,6 +5447,13 @@
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CAppFileLocationProvider.cpp</PATH>
|
||||
@ -5392,7 +5542,7 @@
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
@ -5400,6 +5550,11 @@
|
||||
<PATH>CBrowserShell.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CBrowserWindow.cp</PATH>
|
||||
@ -5540,6 +5695,11 @@
|
||||
<PATH>ContextMenus.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>PP Cursors.rsrc</PATH>
|
||||
@ -5599,7 +5759,13 @@
|
||||
<FILEREF>
|
||||
<TARGETNAME>PPEmbedDebug</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWebBrowserChrome.cpp</PATH>
|
||||
<PATH>CBrowserChrome.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>PPEmbedDebug</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>CWindowCreator.cpp</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
@ -5694,6 +5860,12 @@
|
||||
<PATH>ContextMenus.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>PPEmbedDebug</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>Throbber.r</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</GROUP>
|
||||
<GROUP><NAME>PowerPlant</NAME>
|
||||
<FILEREF>
|
||||
@ -5760,6 +5932,12 @@
|
||||
<PATH>IconServicesLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>PPEmbedDebug</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>QuickTimeLib</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>PPEmbedDebug</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
|
Binary file not shown.
@ -24,22 +24,16 @@
|
||||
#include <Types.r>
|
||||
#include "ApplIDs.h"
|
||||
|
||||
resource 'Mcmd' (mcmd_ContextLinkCmds, "Link") { {
|
||||
/*
|
||||
These are all of the commands which can be done by CBrowserShell in
|
||||
any possible context. PowerPlant's LCMAttachment takes care
|
||||
of removing any commands which should not be enabled for the current
|
||||
click by means of FindCommandStatus of the target (CBrowserShell)
|
||||
*/
|
||||
|
||||
resource 'Mcmd' (mcmd_BrowserShellContextMenuCmds, "BrowserShellContextMenu") { {
|
||||
cmd_OpenLinkInNewWindow,
|
||||
msg_Nothing,
|
||||
cmd_Back,
|
||||
cmd_Forward,
|
||||
cmd_Reload,
|
||||
cmd_Stop,
|
||||
msg_Nothing,
|
||||
cmd_ViewPageSource,
|
||||
msg_Nothing,
|
||||
cmd_SelectAll,
|
||||
cmd_Copy,
|
||||
cmd_CopyLinkLocation,
|
||||
} };
|
||||
|
||||
resource 'Mcmd' (mcmd_ContextImageCmds, "Image") { {
|
||||
cmd_Back,
|
||||
cmd_Forward,
|
||||
cmd_Reload,
|
||||
@ -50,33 +44,10 @@ resource 'Mcmd' (mcmd_ContextImageCmds, "Image") { {
|
||||
msg_Nothing,
|
||||
cmd_SelectAll,
|
||||
cmd_Copy,
|
||||
cmd_CopyLinkLocation,
|
||||
cmd_CopyImageLocation,
|
||||
} };
|
||||
|
||||
resource 'Mcmd' (mcmd_ContextDocumentCmds, "Document") { {
|
||||
cmd_Back,
|
||||
cmd_Forward,
|
||||
cmd_Reload,
|
||||
cmd_Stop,
|
||||
msg_Nothing,
|
||||
cmd_ViewPageSource,
|
||||
msg_Nothing,
|
||||
cmd_SelectAll,
|
||||
cmd_Copy,
|
||||
msg_Nothing,
|
||||
cmd_PrefillForm,
|
||||
} };
|
||||
|
||||
resource 'Mcmd' (mcmd_ContextTextCmds, "Text") { {
|
||||
cmd_Back,
|
||||
cmd_Forward,
|
||||
cmd_Reload,
|
||||
cmd_Stop,
|
||||
msg_Nothing,
|
||||
cmd_ViewPageSource,
|
||||
msg_Nothing,
|
||||
cmd_SelectAll,
|
||||
cmd_Copy,
|
||||
cmd_PrefillForm
|
||||
} };
|
||||
|
||||
/*
|
||||
|
@ -77,10 +77,7 @@ enum {
|
||||
|
||||
// Mcmds
|
||||
enum {
|
||||
mcmd_ContextLinkCmds = 1200,
|
||||
mcmd_ContextImageCmds = 1201,
|
||||
mcmd_ContextDocumentCmds = 1202,
|
||||
mcmd_ContextTextCmds = 1203
|
||||
mcmd_BrowserShellContextMenuCmds = 1200
|
||||
};
|
||||
|
||||
// STR#s
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "ApplIDs.h"
|
||||
#include "CBrowserWindow.h"
|
||||
#include "CBrowserShell.h"
|
||||
#include "CWindowCreator.h"
|
||||
#include "CUrlField.h"
|
||||
#include "CThrobber.h"
|
||||
#include "CIconServicesIcon.h"
|
||||
@ -66,24 +67,20 @@
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "nsIFileChannel.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsMPFileLocProvider.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "macstdlibextras.h"
|
||||
#include "SIOUX.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
#include <TextServices.h>
|
||||
|
||||
#undef NATIVE_PROMPTS
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
#include "CProfileManager.h"
|
||||
#include "nsIProfileChangeStatus.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
static const char* kProgramName = "PPEmbed";
|
||||
|
||||
// ===========================================================================
|
||||
@ -139,7 +136,7 @@ int main()
|
||||
CBrowserApp::CBrowserApp()
|
||||
{
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
mRefCnt = 1;
|
||||
#endif
|
||||
|
||||
@ -157,6 +154,9 @@ CBrowserApp::CBrowserApp()
|
||||
// Register the Appearance Manager/GA classes
|
||||
PP_PowerPlant::UControlRegistry::RegisterClasses();
|
||||
|
||||
// QuickTime is used by CThrobber
|
||||
UQuickTime::Initialize();
|
||||
|
||||
// Register classes used by embedding
|
||||
RegisterClass_(CBrowserShell);
|
||||
RegisterClass_(CBrowserWindow);
|
||||
@ -164,7 +164,7 @@ CBrowserApp::CBrowserApp()
|
||||
RegisterClass_(CThrobber);
|
||||
RegisterClass_(CIconServicesIcon);
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
RegisterClass_(LScroller);
|
||||
RegisterClass_(LTextTableView);
|
||||
RegisterClass_(LColorEraseAttachment);
|
||||
@ -176,7 +176,7 @@ CBrowserApp::CBrowserApp()
|
||||
RegisterClass_(CWebBrowserCMAttachment);
|
||||
AddAttachment(new LCMAttachment);
|
||||
|
||||
SetSleepTime(15);
|
||||
SetSleepTime(5);
|
||||
|
||||
// Get the directory which contains the mozilla parts
|
||||
// In this case it is the app directory but it could
|
||||
@ -207,7 +207,7 @@ CBrowserApp::CBrowserApp()
|
||||
rv = NS_InitEmbedding(macDir, fileLocProvider);
|
||||
|
||||
OverrideComponents();
|
||||
InitializeWindowCreator();
|
||||
CWindowCreator::Initialize();
|
||||
InitializeEmbedEventHandling(this);
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ CBrowserApp::CBrowserApp()
|
||||
CBrowserApp::~CBrowserApp()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
prefs->SavePrefFile(nsnull);
|
||||
|
||||
@ -239,7 +239,7 @@ CBrowserApp::StartUp()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
|
||||
// Register for profile changes
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
@ -267,11 +267,11 @@ CBrowserApp::StartUp()
|
||||
rv = locationProvider->Initialize(rootDir, "guest");
|
||||
ThrowIfError_(rv);
|
||||
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &rv));
|
||||
nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
ThrowIfNil_(prefs);
|
||||
// Needed because things read default prefs during startup
|
||||
prefs->ResetPrefs();
|
||||
prefs->ReadUserPrefs();
|
||||
prefs->ResetUserPrefs();
|
||||
prefs->ReadUserPrefs(nsnull);
|
||||
|
||||
#endif
|
||||
|
||||
@ -387,10 +387,11 @@ void CBrowserApp::HandleAppleEvent(const AppleEvent& inAppleEvent,
|
||||
else
|
||||
chromeFlags = nsIWebBrowserChrome::CHROME_DEFAULT;
|
||||
|
||||
CBrowserWindow *theWindow = CBrowserWindow::CreateWindow(chromeFlags, -1, -1);
|
||||
LWindow *theWindow = CWindowCreator::CreateWindowInternal(chromeFlags, -1, -1);
|
||||
ThrowIfNil_(theWindow);
|
||||
theWindow->SetSizeToContent(false);
|
||||
theWindow->GetBrowserShell()->LoadURL(dataAsStr);
|
||||
CBrowserShell *theBrowser = dynamic_cast<CBrowserShell*>(theWindow->FindPaneByID(CBrowserShell::paneID_MainBrowser));
|
||||
ThrowIfNil_(theBrowser);
|
||||
theBrowser->LoadURL(dataAsStr);
|
||||
|
||||
theWindow->Show();
|
||||
}
|
||||
@ -417,13 +418,14 @@ CBrowserApp::ObeyCommand(
|
||||
switch (inCommand) {
|
||||
|
||||
case PP_PowerPlant::cmd_New:
|
||||
{
|
||||
CBrowserWindow *theWindow = CBrowserWindow::CreateWindow(nsIWebBrowserChrome::CHROME_DEFAULT, -1, -1);
|
||||
ThrowIfNil_(theWindow);
|
||||
theWindow->SetSizeToContent(false);
|
||||
// Just for demo sake, load a URL
|
||||
theWindow->GetBrowserShell()->LoadURL(nsDependentCString("http://www.mozilla.org"));
|
||||
theWindow->Show();
|
||||
{
|
||||
LWindow *theWindow = CWindowCreator::CreateWindowInternal(nsIWebBrowserChrome::CHROME_DEFAULT, -1, -1);
|
||||
ThrowIfNil_(theWindow);
|
||||
CBrowserShell *theBrowser = dynamic_cast<CBrowserShell*>(theWindow->FindPaneByID(CBrowserShell::paneID_MainBrowser));
|
||||
ThrowIfNil_(theBrowser);
|
||||
// Just for demo sake, load a URL
|
||||
theBrowser->LoadURL(nsDependentCString("http://www.mozilla.org"));
|
||||
theWindow->Show();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -438,21 +440,16 @@ CBrowserApp::ObeyCommand(
|
||||
|
||||
rv = NS_NewLocalFileWithFSSpec(&fileSpec, PR_TRUE, getter_AddRefs(macFile));
|
||||
ThrowIfError_(NS_ERROR_GET_CODE(rv));
|
||||
|
||||
nsXPIDLCString urlSpec;
|
||||
rv = NS_GetURLSpecFromFile(macFile, getter_Copies(urlSpec));
|
||||
ThrowIfError_(NS_ERROR_GET_CODE(rv));
|
||||
nsCOMPtr<nsIFileURL> aURL(do_CreateInstance("@mozilla.org/network/standard-url;1", &rv));
|
||||
ThrowIfError_(NS_ERROR_GET_CODE(rv));
|
||||
|
||||
rv = aURL->SetFile(macFile);
|
||||
ThrowIfError_(NS_ERROR_GET_CODE(rv));
|
||||
|
||||
nsXPIDLCString urlSpec;
|
||||
rv = aURL->GetSpec(getter_Copies(urlSpec));
|
||||
ThrowIfError_(NS_ERROR_GET_CODE(rv));
|
||||
|
||||
CBrowserWindow *theWindow = CBrowserWindow::CreateWindow(nsIWebBrowserChrome::CHROME_DEFAULT, -1, -1);
|
||||
|
||||
LWindow *theWindow = CWindowCreator::CreateWindowInternal(nsIWebBrowserChrome::CHROME_DEFAULT, -1, -1);
|
||||
ThrowIfNil_(theWindow);
|
||||
theWindow->SetSizeToContent(false);
|
||||
theWindow->GetBrowserShell()->LoadURL(urlSpec);
|
||||
CBrowserShell *theBrowser = dynamic_cast<CBrowserShell*>(theWindow->FindPaneByID(CBrowserShell::paneID_MainBrowser));
|
||||
ThrowIfNil_(theBrowser);
|
||||
theBrowser->LoadURL(urlSpec);
|
||||
theWindow->Show();
|
||||
}
|
||||
}
|
||||
@ -525,30 +522,32 @@ Boolean CBrowserApp::AttemptQuitSelf(SInt32 inSaveOption)
|
||||
|
||||
nsresult CBrowserApp::InitializePrefs()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &rv));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// We are using the default prefs from mozilla. If you were
|
||||
// disributing your own, this would be done simply by editing
|
||||
// the default pref files.
|
||||
|
||||
PRBool inited;
|
||||
rv = prefs->GetBoolPref("ppbrowser.prefs_inited", &inited);
|
||||
if (NS_FAILED(rv) || !inited)
|
||||
{
|
||||
prefs->SetIntPref("font.size.variable.x-western", 12);
|
||||
prefs->SetIntPref("font.size.fixed.x-western", 12);
|
||||
rv = prefs->SetBoolPref("ppbrowser.prefs_inited", PR_TRUE);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = prefs->SavePrefFile(nsnull);
|
||||
}
|
||||
// We are using the default prefs from mozilla. If you were
|
||||
// disributing your own, this would be done simply by editing
|
||||
// the default pref files.
|
||||
nsCOMPtr<nsIPrefBranch> branch;
|
||||
rv = prefs->GetBranch(nsnull, getter_AddRefs(branch));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
const char kVariableFontSizePref[] = "font.size.variable.x-western";
|
||||
const char kFixedFontSizePref[] = "font.size.fixed.x-western";
|
||||
|
||||
PRInt32 intValue;
|
||||
rv = branch->GetIntPref(kVariableFontSizePref, &intValue);
|
||||
if (NS_FAILED(rv))
|
||||
branch->SetIntPref(kVariableFontSizePref, 14);
|
||||
|
||||
}
|
||||
else
|
||||
NS_ASSERTION(PR_FALSE, "Could not get preferences service");
|
||||
rv = branch->GetIntPref(kFixedFontSizePref, &intValue);
|
||||
if (NS_FAILED(rv))
|
||||
branch->SetIntPref(kFixedFontSizePref, 13);
|
||||
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Boolean CBrowserApp::SelectFileObject(PP_PowerPlant::CommandT inCommand,
|
||||
@ -576,7 +575,8 @@ Boolean CBrowserApp::SelectFileObject(PP_PowerPlant::CommandT inCommand,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#if USE_PROFILES
|
||||
|
||||
#ifdef USE_PROFILES
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// CBrowserApp : nsISupports
|
||||
@ -615,7 +615,7 @@ NS_IMETHODIMP CBrowserApp::Observe(nsISupports *aSubject, const char *aTopic, co
|
||||
while (iterator.Previous(theSub)) {
|
||||
CBrowserWindow *browserWindow = dynamic_cast<CBrowserWindow*>(theSub);
|
||||
if (browserWindow) {
|
||||
browserWindow->Stop();
|
||||
//browserWindow->Stop();
|
||||
mSubCommanders.RemoveItemsAt(1, iterator.GetCurrentIndex());
|
||||
delete browserWindow;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
class CBrowserApp : public PP_PowerPlant::LApplication
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
,public nsIObserver
|
||||
,public nsSupportsWeakReference
|
||||
#endif
|
||||
@ -42,7 +42,7 @@ public:
|
||||
CBrowserApp(); // constructor registers PPobs
|
||||
virtual ~CBrowserApp(); // stub destructor
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
#endif
|
||||
@ -77,7 +77,7 @@ protected:
|
||||
virtual Boolean SelectFileObject(PP_PowerPlant::CommandT inCommand,
|
||||
FSSpec& outSpec);
|
||||
|
||||
#if USE_PROFILES
|
||||
#ifdef USE_PROFILES
|
||||
Boolean ConfirmProfileSwitch();
|
||||
#endif
|
||||
|
||||
|
@ -45,6 +45,8 @@
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsIDOMHTMLLinkElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIWebBrowserFind.h"
|
||||
#include "nsIWebBrowserFocus.h"
|
||||
#include "nsIWebBrowserPersist.h"
|
||||
@ -54,31 +56,188 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIWidget.h"
|
||||
|
||||
#include <UModalDialogs.h>
|
||||
#include <LStream.h>
|
||||
#include <UNavServicesDialogs.h>
|
||||
|
||||
// Local
|
||||
#include "ApplIDs.h"
|
||||
#include "CBrowserWindow.h"
|
||||
#include "CBrowserMsgDefs.h"
|
||||
#include "CBrowserChrome.h"
|
||||
#include "CWebBrowserCMAttachment.h"
|
||||
#include "UMacUnicode.h"
|
||||
|
||||
// PowerPlant
|
||||
#ifndef _H_LEditText
|
||||
#include "LEditText.h"
|
||||
#endif
|
||||
#include <UModalDialogs.h>
|
||||
#include <LStream.h>
|
||||
#include <UNavServicesDialogs.h>
|
||||
#include <LEditText.h>
|
||||
#include <LCheckBox.h>
|
||||
#include <UEventMgr.h>
|
||||
|
||||
#ifndef _H_LCheckBox
|
||||
#include "LCheckBox.h"
|
||||
#endif
|
||||
// ToolBox
|
||||
#include <InternetConfig.h>
|
||||
|
||||
static NS_DEFINE_IID(kWindowCID, NS_WINDOW_CID);
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShellProgressListener
|
||||
//*****************************************************************************
|
||||
|
||||
class CBrowserShellProgressListener : public nsIWebProgressListener,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
CBrowserShellProgressListener(CBrowserShell* itsOwner);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBPROGRESSLISTENER
|
||||
|
||||
void SetOwner(CBrowserShell* itsOwner)
|
||||
{ mpOwner = itsOwner; }
|
||||
|
||||
PRBool GetIsLoading()
|
||||
{ return mLoading; }
|
||||
|
||||
protected:
|
||||
virtual ~CBrowserShellProgressListener();
|
||||
|
||||
protected:
|
||||
CBrowserShell *mpOwner;
|
||||
PRBool mLoading;
|
||||
PRBool mUseRealProgFlag;
|
||||
PRInt32 mFinishedRequests, mTotalRequests;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS2(CBrowserShellProgressListener, nsIWebProgressListener, nsISupportsWeakReference)
|
||||
|
||||
CBrowserShellProgressListener::CBrowserShellProgressListener(CBrowserShell* itsOwner) :
|
||||
mpOwner(itsOwner),
|
||||
mLoading(PR_FALSE), mUseRealProgFlag(PR_FALSE),
|
||||
mFinishedRequests(0), mTotalRequests(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CBrowserShellProgressListener::~CBrowserShellProgressListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserShellProgressListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
|
||||
{
|
||||
NS_ENSURE_TRUE(mpOwner, NS_ERROR_NULL_POINTER);
|
||||
|
||||
if (aStateFlags & STATE_START)
|
||||
{
|
||||
if (aStateFlags & STATE_IS_NETWORK)
|
||||
{
|
||||
MsgNetStartInfo startInfo(mpOwner);
|
||||
mpOwner->BroadcastMessage(msg_OnNetStartChange, &startInfo);
|
||||
mLoading = true;
|
||||
|
||||
// Init progress vars
|
||||
mUseRealProgFlag = false;
|
||||
mTotalRequests = 0;
|
||||
mFinishedRequests = 0;
|
||||
}
|
||||
if (aStateFlags & STATE_IS_REQUEST)
|
||||
mTotalRequests++;
|
||||
}
|
||||
else if (aStateFlags & STATE_STOP)
|
||||
{
|
||||
if (aStateFlags & STATE_IS_REQUEST)
|
||||
{
|
||||
mFinishedRequests += 1;
|
||||
|
||||
if (!mUseRealProgFlag)
|
||||
{
|
||||
MsgOnProgressChangeInfo progInfo(mpOwner, mFinishedRequests, mTotalRequests);
|
||||
mpOwner->BroadcastMessage(msg_OnProgressChange, &progInfo);
|
||||
}
|
||||
}
|
||||
if (aStateFlags & STATE_IS_NETWORK)
|
||||
{
|
||||
MsgNetStopInfo stopInfo(mpOwner);
|
||||
mpOwner->BroadcastMessage(msg_OnNetStopChange, &stopInfo);
|
||||
mLoading = false;
|
||||
}
|
||||
}
|
||||
else if (aStateFlags & STATE_TRANSFERRING)
|
||||
{
|
||||
|
||||
if (aStateFlags & STATE_IS_DOCUMENT)
|
||||
{
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
|
||||
NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);
|
||||
nsXPIDLCString contentType;
|
||||
channel->GetContentType(getter_Copies(contentType));
|
||||
if (strcmp(contentType.get(), "text/html"))
|
||||
mUseRealProgFlag = true;
|
||||
}
|
||||
|
||||
if (aStateFlags & STATE_IS_REQUEST)
|
||||
{
|
||||
if (!mUseRealProgFlag)
|
||||
{
|
||||
MsgOnProgressChangeInfo progInfo(mpOwner, mFinishedRequests, mTotalRequests);
|
||||
mpOwner->BroadcastMessage(msg_OnProgressChange, &progInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserShellProgressListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
|
||||
{
|
||||
NS_ENSURE_TRUE(mpOwner, NS_ERROR_NULL_POINTER);
|
||||
|
||||
if (!mUseRealProgFlag)
|
||||
return NS_OK;
|
||||
|
||||
MsgOnProgressChangeInfo progInfo(mpOwner, aCurTotalProgress, aMaxTotalProgress);
|
||||
mpOwner->BroadcastMessage(msg_OnProgressChange, &progInfo);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserShellProgressListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
|
||||
{
|
||||
NS_ENSURE_TRUE(mpOwner, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsXPIDLCString spec;
|
||||
|
||||
if (location)
|
||||
location->GetSpec(getter_Copies(spec));
|
||||
|
||||
MsgLocationChangeInfo info(mpOwner, spec.get());
|
||||
mpOwner->BroadcastMessage(msg_OnLocationChange, &info);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserShellProgressListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
|
||||
{
|
||||
NS_ENSURE_TRUE(mpOwner, NS_ERROR_NULL_POINTER);
|
||||
|
||||
MsgStatusChangeInfo info(mpOwner, aStatus, aMessage);
|
||||
mpOwner->BroadcastMessage(msg_OnStatusChange, &info);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserShellProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShell: constructors/destructor
|
||||
//*****************************************************************************
|
||||
|
||||
CBrowserShell::CBrowserShell()
|
||||
CBrowserShell::CBrowserShell() :
|
||||
mChromeFlags(nsIWebBrowserChrome::CHROME_DEFAULT), mIsMainContent(true),
|
||||
mContextMenuContext(nsIContextMenuListener::CONTEXT_NONE), mContextMenuDOMNode(nsnull)
|
||||
{
|
||||
nsresult rv = CommonConstruct();
|
||||
if (rv != NS_OK)
|
||||
@ -87,8 +246,12 @@ CBrowserShell::CBrowserShell()
|
||||
|
||||
|
||||
CBrowserShell::CBrowserShell(const SPaneInfo &inPaneInfo,
|
||||
const SViewInfo &inViewInfo) :
|
||||
LView(inPaneInfo, inViewInfo)
|
||||
const SViewInfo &inViewInfo,
|
||||
const UInt32 inChromeFlags,
|
||||
const Boolean inIsMainContent) :
|
||||
LView(inPaneInfo, inViewInfo),
|
||||
mChromeFlags(inChromeFlags), mIsMainContent(inIsMainContent),
|
||||
mContextMenuContext(nsIContextMenuListener::CONTEXT_NONE), mContextMenuDOMNode(nsnull)
|
||||
{
|
||||
nsresult rv = CommonConstruct();
|
||||
if (rv != NS_OK)
|
||||
@ -97,9 +260,11 @@ CBrowserShell::CBrowserShell(const SPaneInfo &inPaneInfo,
|
||||
|
||||
|
||||
CBrowserShell::CBrowserShell(LStream* inStream) :
|
||||
LView(inStream)
|
||||
LView(inStream),
|
||||
mContextMenuContext(nsIContextMenuListener::CONTEXT_NONE), mContextMenuDOMNode(nsnull)
|
||||
{
|
||||
*inStream >> (StringPtr) mInitURL;
|
||||
*inStream >> mChromeFlags;
|
||||
*inStream >> mIsMainContent;
|
||||
|
||||
nsresult rv = CommonConstruct();
|
||||
if (rv != NS_OK)
|
||||
@ -109,7 +274,19 @@ CBrowserShell::CBrowserShell(LStream* inStream) :
|
||||
|
||||
CBrowserShell::~CBrowserShell()
|
||||
{
|
||||
// nsCOMPtr destructors, do your thing
|
||||
if (mWebBrowser)
|
||||
mWebBrowser->SetContainerWindow(nsnull);
|
||||
|
||||
if (mChrome)
|
||||
{
|
||||
mChrome->SetBrowserShell(nsnull);
|
||||
NS_RELEASE(mChrome);
|
||||
}
|
||||
if (mProgressListener)
|
||||
{
|
||||
mProgressListener->SetOwner(nsnull);
|
||||
NS_RELEASE(mProgressListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,10 +304,65 @@ NS_IMETHODIMP CBrowserShell::CommonConstruct()
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mWebBrowser));
|
||||
NS_ENSURE_TRUE(webNav, NS_ERROR_FAILURE);
|
||||
mWebBrowserAsWebNav = webNav;
|
||||
|
||||
mChrome = new CBrowserChrome(this, mChromeFlags, mIsMainContent);
|
||||
NS_ENSURE_TRUE(mChrome, NS_ERROR_FAILURE);
|
||||
NS_ADDREF(mChrome);
|
||||
AddListener(mChrome);
|
||||
mWebBrowser->SetContainerWindow(mChrome);
|
||||
|
||||
mProgressListener = new CBrowserShellProgressListener(this);
|
||||
NS_ENSURE_TRUE(mProgressListener, NS_ERROR_FAILURE);
|
||||
NS_ADDREF(mProgressListener);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* It is a nescesary evil to create a top level window widget in order to
|
||||
* have a parent for our nsIBaseWindow. In order to not put that responsibility
|
||||
* onto the PowerPlant window which contains us, we do it ourselves here by
|
||||
* creating the widget if it does not exist and storing it as a window property.
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP CBrowserShell::EnsureTopLevelWidget(nsIWidget **aWidget)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aWidget);
|
||||
*aWidget = nsnull;
|
||||
|
||||
OSStatus err;
|
||||
nsresult rv;
|
||||
nsIWidget *widget = nsnull;
|
||||
|
||||
err = ::GetWindowProperty(Compat_GetMacWindow(), 'PPMZ', 'WIDG', sizeof(nsIWidget*), nsnull, (void*)&widget);
|
||||
if (err == noErr && widget) {
|
||||
*aWidget = widget;
|
||||
NS_ADDREF(*aWidget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Create it with huge bounds. The actual bounds that matters is that of the
|
||||
// nsIBaseWindow. The bounds of the top level widget clips its children so
|
||||
// we just have to make sure it is big enough to always contain the children.
|
||||
|
||||
nsCOMPtr<nsIWidget> newWidget(do_CreateInstance(kWindowCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsRect r(0, 0, 32000, 32000);
|
||||
rv = newWidget->Create(Compat_GetMacWindow(), r, nsnull, nsnull, nsnull, nsnull, nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
widget = newWidget;
|
||||
err = ::SetWindowProperty(Compat_GetMacWindow(), 'PPMZ', 'WIDG', sizeof(nsIWidget*), (void*)&widget);
|
||||
if (err == noErr) {
|
||||
*aWidget = newWidget;
|
||||
NS_ADDREF(*aWidget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShell: LPane overrides
|
||||
@ -139,14 +371,9 @@ NS_IMETHODIMP CBrowserShell::CommonConstruct()
|
||||
void CBrowserShell::FinishCreateSelf()
|
||||
{
|
||||
FocusDraw();
|
||||
|
||||
CBrowserWindow *ourWindow = dynamic_cast<CBrowserWindow*>(LWindow::FetchWindowObject(Compat_GetMacWindow()));
|
||||
ThrowIfNil_(ourWindow);
|
||||
ourWindow->AddListener(this);
|
||||
|
||||
nsCOMPtr<nsIWidget> aWidget;
|
||||
ourWindow->GetWidget(getter_AddRefs(aWidget));
|
||||
ThrowIfNil_(aWidget);
|
||||
|
||||
nsCOMPtr<nsIWidget> aWidget;
|
||||
ThrowIfError_(EnsureTopLevelWidget(getter_AddRefs(aWidget)));
|
||||
|
||||
// the widget is also our avenue for dispatching events into Gecko via
|
||||
// nsIEventSink. Save this sink for later.
|
||||
@ -159,21 +386,16 @@ void CBrowserShell::FinishCreateSelf()
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIWebBrowserChrome> ourChrome;
|
||||
ourWindow->GetIWebBrowserChrome(getter_AddRefs(ourChrome));
|
||||
ThrowIfNil_(ourChrome);
|
||||
|
||||
mWebBrowser->SetContainerWindow(ourChrome);
|
||||
mWebBrowserAsBaseWin->InitWindow(aWidget->GetNativeData(NS_NATIVE_WIDGET), nsnull, r.x, r.y, r.width, r.height);
|
||||
mWebBrowserAsBaseWin->Create();
|
||||
|
||||
nsWeakPtr weakling(dont_AddRef(NS_GetWeakReference(ourChrome)));
|
||||
|
||||
// Hook up our progress listener
|
||||
nsWeakPtr weakling(dont_AddRef(NS_GetWeakReference((nsIWebProgressListener *)mProgressListener)));
|
||||
rv = mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Call to AddWebBrowserListener failed");
|
||||
|
||||
AdjustFrame();
|
||||
StartRepeating();
|
||||
StartListening();
|
||||
}
|
||||
|
||||
|
||||
@ -302,6 +524,22 @@ Boolean CBrowserShell::ObeyCommand(PP_PowerPlant::CommandT inCommand, void* ioPa
|
||||
|
||||
switch (inCommand)
|
||||
{
|
||||
case cmd_Back:
|
||||
Back();
|
||||
break;
|
||||
|
||||
case cmd_Forward:
|
||||
Forward();
|
||||
break;
|
||||
|
||||
case cmd_Stop:
|
||||
Stop();
|
||||
break;
|
||||
|
||||
case cmd_Reload:
|
||||
Reload();
|
||||
break;
|
||||
|
||||
case cmd_SaveAs:
|
||||
rv = SaveCurrentURI();
|
||||
ThrowIfError_(rv);
|
||||
@ -344,6 +582,23 @@ Boolean CBrowserShell::ObeyCommand(PP_PowerPlant::CommandT inCommand, void* ioPa
|
||||
FindNext();
|
||||
break;
|
||||
|
||||
case cmd_OpenLinkInNewWindow:
|
||||
{
|
||||
// Get the URL from the link
|
||||
ThrowIfNil_(mContextMenuDOMNode);
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> linkElement(do_QueryInterface(mContextMenuDOMNode, &rv));
|
||||
ThrowIfError_(rv);
|
||||
|
||||
nsAutoString href;
|
||||
rv = linkElement->GetHref(href);
|
||||
ThrowIfError_(rv);
|
||||
|
||||
nsCAutoString urlSpec;
|
||||
CopyUCS2toASCII(href, urlSpec);
|
||||
PostOpenURLEvent(urlSpec);
|
||||
}
|
||||
break;
|
||||
|
||||
case cmd_SaveFormData:
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
@ -379,6 +634,16 @@ Boolean CBrowserShell::ObeyCommand(PP_PowerPlant::CommandT inCommand, void* ioPa
|
||||
}
|
||||
break;
|
||||
|
||||
case cmd_ViewPageSource:
|
||||
{
|
||||
nsCAutoString currentURL;
|
||||
rv = GetCurrentURL(currentURL);
|
||||
ThrowIfError_(rv);
|
||||
currentURL.Insert("view-source:", 0);
|
||||
PostOpenURLEvent(currentURL);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
cmdHandled = LCommander::ObeyCommand(inCommand, ioParam);
|
||||
break;
|
||||
@ -393,59 +658,100 @@ void CBrowserShell::FindCommandStatus(PP_PowerPlant::CommandT inCommand,
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIClipboardCommands> clipCmd;
|
||||
PRBool canDo;
|
||||
PRBool haveContent, canDo;
|
||||
nsCOMPtr<nsIURI> currURI;
|
||||
|
||||
rv = mWebBrowserAsWebNav->GetCurrentURI(getter_AddRefs(currURI));
|
||||
haveContent = NS_SUCCEEDED(rv) && currURI;
|
||||
|
||||
switch (inCommand)
|
||||
{
|
||||
case cmd_Back:
|
||||
outEnabled = CanGoBack();
|
||||
break;
|
||||
|
||||
case cmd_Forward:
|
||||
outEnabled = CanGoForward();
|
||||
break;
|
||||
|
||||
case cmd_Stop:
|
||||
outEnabled = IsBusy();
|
||||
break;
|
||||
|
||||
case cmd_Reload:
|
||||
outEnabled = haveContent;
|
||||
break;
|
||||
|
||||
case cmd_SaveAs:
|
||||
case cmd_SaveAllAs:
|
||||
rv = mWebBrowserAsWebNav->GetCurrentURI(getter_AddRefs(currURI));
|
||||
outEnabled = NS_SUCCEEDED(rv);
|
||||
outEnabled = haveContent;
|
||||
break;
|
||||
|
||||
case cmd_Cut:
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanCutSelection(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
if (haveContent) {
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanCutSelection(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case cmd_Copy:
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanCopySelection(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
if (haveContent) {
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanCopySelection(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case cmd_Paste:
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanPaste(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
if (haveContent) {
|
||||
rv = GetClipboardHandler(getter_AddRefs(clipCmd));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = clipCmd->CanPaste(&canDo);
|
||||
outEnabled = NS_SUCCEEDED(rv) && canDo;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case cmd_SelectAll:
|
||||
outEnabled = PR_TRUE;
|
||||
outEnabled = haveContent;
|
||||
break;
|
||||
|
||||
case cmd_Find:
|
||||
outEnabled = true;
|
||||
outEnabled = haveContent;
|
||||
break;
|
||||
|
||||
case cmd_FindNext:
|
||||
outEnabled = CanFindNext();
|
||||
outEnabled = haveContent && CanFindNext();
|
||||
break;
|
||||
|
||||
case cmd_OpenLinkInNewWindow:
|
||||
outEnabled = haveContent && ((mContextMenuContext & nsIContextMenuListener::CONTEXT_LINK) != 0);
|
||||
break;
|
||||
|
||||
case cmd_ViewPageSource:
|
||||
outEnabled = haveContent && ((mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) == 0);
|
||||
break;
|
||||
|
||||
case cmd_ViewImage:
|
||||
case cmd_CopyImageLocation:
|
||||
outEnabled = haveContent && ((mContextMenuContext & nsIContextMenuListener::CONTEXT_IMAGE) != 0);
|
||||
break;
|
||||
|
||||
case cmd_CopyLinkLocation:
|
||||
outEnabled = haveContent && ((mContextMenuContext & nsIContextMenuListener::CONTEXT_LINK) != 0);
|
||||
break;
|
||||
|
||||
case cmd_SaveFormData:
|
||||
outEnabled = HasFormElements();
|
||||
outEnabled = haveContent && HasFormElements();
|
||||
break;
|
||||
|
||||
case cmd_PrefillForm:
|
||||
outEnabled = HasFormElements();
|
||||
outEnabled = haveContent && HasFormElements();
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -479,32 +785,25 @@ void CBrowserShell::SpendTime(const EventRecord& inMacEvent)
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShell: LListener overrides
|
||||
//*****************************************************************************
|
||||
|
||||
void CBrowserShell::ListenToMessage(MessageT inMessage,
|
||||
void* ioParam)
|
||||
{
|
||||
switch (inMessage)
|
||||
{
|
||||
case msg_OnStartLoadDocument:
|
||||
case msg_OnEndLoadDocument:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShell:
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP CBrowserShell::SetTopLevelWindow(nsIWebBrowserChrome * aTopLevelWindow)
|
||||
void CBrowserShell::AddAttachments()
|
||||
{
|
||||
return mWebBrowser->SetContainerWindow(aTopLevelWindow);
|
||||
// Only add a context menu attachment for full browser windows -
|
||||
// not view-source and chrome dialogs.
|
||||
if ((mChromeFlags & (nsIWebBrowserChrome::CHROME_TOOLBAR |
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR)) != 0)
|
||||
{
|
||||
CWebBrowserCMAttachment *cmAttachment = new CWebBrowserCMAttachment(this);
|
||||
ThrowIfNil_(cmAttachment);
|
||||
cmAttachment->SetCommandList(mcmd_BrowserShellContextMenuCmds);
|
||||
AddAttachment(cmAttachment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD CBrowserShell::GetWebBrowser(nsIWebBrowser** aBrowser)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBrowser);
|
||||
@ -521,12 +820,17 @@ NS_METHOD CBrowserShell::SetWebBrowser(nsIWebBrowser* aBrowser)
|
||||
|
||||
FocusDraw();
|
||||
|
||||
/*
|
||||
CBrowserWindow *ourWindow = dynamic_cast<CBrowserWindow*>(LWindow::FetchWindowObject(Compat_GetMacWindow()));
|
||||
NS_ENSURE_TRUE(ourWindow, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIWidget> aWidget;
|
||||
ourWindow->GetWidget(getter_AddRefs(aWidget));
|
||||
NS_ENSURE_TRUE(aWidget, NS_ERROR_FAILURE);
|
||||
*/
|
||||
|
||||
nsCOMPtr<nsIWidget> aWidget;
|
||||
ThrowIfError_(EnsureTopLevelWidget(getter_AddRefs(aWidget)));
|
||||
|
||||
mWebBrowser = aBrowser;
|
||||
|
||||
@ -550,6 +854,12 @@ NS_METHOD CBrowserShell::SetWebBrowser(nsIWebBrowser* aBrowser)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD CBrowserShell::GetWebBrowserChrome(nsIWebBrowserChrome** aChrome)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aChrome);
|
||||
return mChrome->QueryInterface(NS_GET_IID(nsIWebBrowserChrome), (void **)aChrome);
|
||||
}
|
||||
|
||||
NS_METHOD CBrowserShell::GetContentViewer(nsIContentViewer** aViewer)
|
||||
{
|
||||
nsCOMPtr<nsIDocShell> ourDocShell(do_GetInterface(mWebBrowser));
|
||||
@ -562,6 +872,12 @@ NS_METHOD CBrowserShell::GetContentViewer(nsIContentViewer** aViewer)
|
||||
//*** CBrowserShell: Navigation
|
||||
//*****************************************************************************
|
||||
|
||||
Boolean CBrowserShell::IsBusy()
|
||||
{
|
||||
return mProgressListener->GetIsLoading();
|
||||
}
|
||||
|
||||
|
||||
Boolean CBrowserShell::CanGoBack()
|
||||
{
|
||||
PRBool canDo;
|
||||
@ -807,8 +1123,7 @@ Boolean CBrowserShell::Find()
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Boolean CBrowserShell::Find(const nsString& searchString,
|
||||
Boolean CBrowserShell::Find(const nsAString& searchString,
|
||||
Boolean findBackwards,
|
||||
Boolean wrapFind,
|
||||
Boolean entireWord,
|
||||
@ -821,7 +1136,7 @@ Boolean CBrowserShell::Find(const nsString& searchString,
|
||||
nsCOMPtr<nsIWebBrowserFind> finder(do_GetInterface(mWebBrowser));
|
||||
if (!finder) return FALSE;
|
||||
|
||||
finder->SetSearchString(searchString.get());
|
||||
finder->SetSearchString(PromiseFlatString(searchString).get());
|
||||
finder->SetFindBackwards(findBackwards);
|
||||
finder->SetWrapFind(wrapFind);
|
||||
finder->SetEntireWord(entireWord);
|
||||
@ -865,6 +1180,54 @@ Boolean CBrowserShell::FindNext()
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD CBrowserShell::OnShowContextMenu(PRUint32 aContextFlags,
|
||||
nsIDOMEvent *aEvent,
|
||||
nsIDOMNode *aNode)
|
||||
{
|
||||
// Find our CWebBrowserCMAttachment, if any
|
||||
CWebBrowserCMAttachment *aCMAttachment = nsnull;
|
||||
const TArray<LAttachment*>* theAttachments = GetAttachmentsList();
|
||||
|
||||
if (theAttachments) {
|
||||
TArrayIterator<LAttachment*> iterate(*theAttachments);
|
||||
|
||||
LAttachment* theAttach;
|
||||
while (iterate.Next(theAttach)) {
|
||||
aCMAttachment = dynamic_cast<CWebBrowserCMAttachment*>(theAttach);
|
||||
if (aCMAttachment != nil)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!aCMAttachment) {
|
||||
NS_ASSERTION(PR_FALSE, "No CWebBrowserCMAttachment");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
EventRecord macEvent;
|
||||
UEventMgr::GetMouseAndModifiers(macEvent);
|
||||
|
||||
mContextMenuContext = aContextFlags;
|
||||
mContextMenuDOMNode = aNode;
|
||||
aCMAttachment->DoContextMenuClick(macEvent);
|
||||
mContextMenuContext = 0;
|
||||
mContextMenuDOMNode = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD CBrowserShell::OnShowTooltip(PRInt32 aXCoords,
|
||||
PRInt32 aYCoords,
|
||||
const PRUnichar *aTipText)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_METHOD CBrowserShell::OnHideTooltip()
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
void CBrowserShell::HandleMouseMoved(const EventRecord& inMacEvent)
|
||||
{
|
||||
if (IsActive())
|
||||
@ -888,7 +1251,7 @@ void CBrowserShell::AdjustFrame()
|
||||
}
|
||||
|
||||
|
||||
Boolean CBrowserShell::DoFindDialog(nsString& searchText,
|
||||
Boolean CBrowserShell::DoFindDialog(nsAString& searchText,
|
||||
PRBool& findBackwards,
|
||||
PRBool& wrapFind,
|
||||
PRBool& entireWord,
|
||||
@ -911,11 +1274,11 @@ Boolean CBrowserShell::DoFindDialog(nsString& searchText,
|
||||
|
||||
StDialogHandler theHandler(dlog_FindDialog, this);
|
||||
LWindow *theDialog = theHandler.GetDialog();
|
||||
Str255 aStr;
|
||||
Str255 aStr;
|
||||
|
||||
// Set initial text for string in dialog box
|
||||
|
||||
CPlatformUCSConversion::GetInstance()->UCSToPlatform(searchText, aStr);
|
||||
CPlatformUCSConversion::GetInstance()->UCSToPlatform(searchText, aStr);
|
||||
|
||||
LEditText *editField = dynamic_cast<LEditText*>(theDialog->FindPaneByID(kSearchTextEdit));
|
||||
editField->SetDescriptor(aStr);
|
||||
@ -951,7 +1314,7 @@ Boolean CBrowserShell::DoFindDialog(nsString& searchText,
|
||||
else if (hitMessage == msg_OK)
|
||||
{
|
||||
editField->GetDescriptor(aStr);
|
||||
CPlatformUCSConversion::GetInstance()->PlatformToUCS(aStr, searchText);
|
||||
CPlatformUCSConversion::GetInstance()->PlatformToUCS(aStr, searchText);
|
||||
|
||||
caseSensitive = caseSensCheck->GetValue() ? TRUE : FALSE;
|
||||
entireWord = entireWordCheck->GetValue() ? TRUE : FALSE;
|
||||
@ -1008,3 +1371,43 @@ Boolean CBrowserShell::HasFormElements()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CBrowserShell::PostOpenURLEvent(const nsACString& url)
|
||||
{
|
||||
// Send an AppleEvent to ourselves to open a new window with the given URL
|
||||
|
||||
// IMPORTANT: We need to make our target address using a ProcessSerialNumber
|
||||
// from GetCurrentProcess. This will cause our AppleEvent to be handled from
|
||||
// the event loop. Creating and showing a new window before the context menu
|
||||
// click is done being processed is fatal. If we make the target address with a
|
||||
// ProcessSerialNumber in which highLongOfPSN == 0 && lowLongOfPSN == kCurrentProcess,
|
||||
// the event will be dispatched to us directly and we die.
|
||||
|
||||
OSErr err;
|
||||
ProcessSerialNumber currProcess;
|
||||
StAEDescriptor selfAddrDesc;
|
||||
|
||||
err = ::GetCurrentProcess(&currProcess);
|
||||
ThrowIfOSErr_(err);
|
||||
err = ::AECreateDesc(typeProcessSerialNumber, (Ptr) &currProcess,
|
||||
sizeof(currProcess), selfAddrDesc);
|
||||
ThrowIfOSErr_(err);
|
||||
|
||||
AppleEvent getURLEvent;
|
||||
err = ::AECreateAppleEvent(kInternetEventClass, kAEGetURL,
|
||||
selfAddrDesc,
|
||||
kAutoGenerateReturnID,
|
||||
kAnyTransactionID,
|
||||
&getURLEvent);
|
||||
ThrowIfOSErr_(err);
|
||||
|
||||
const nsPromiseFlatCString& flatURL = PromiseFlatCString(url);
|
||||
StAEDescriptor urlDesc(typeChar, flatURL.get(), flatURL.Length());
|
||||
|
||||
err = ::AEPutParamDesc(&getURLEvent, keyDirectObject, urlDesc);
|
||||
if (err) {
|
||||
::AEDisposeDesc(&getURLEvent);
|
||||
Throw_(err);
|
||||
}
|
||||
UAppleEventsMgr::SendAppleEvent(getURLEvent);
|
||||
}
|
||||
|
@ -29,22 +29,21 @@
|
||||
#include <LListener.h>
|
||||
#include <LString.h>
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAString.h"
|
||||
#include "nsIWebBrowser.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIEventSink.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIWebProgress.h"
|
||||
|
||||
#ifndef nsCOMPtr_h___
|
||||
#include "nsCOMPtr.h"
|
||||
#endif
|
||||
class CBrowserChrome;
|
||||
class CBrowserShellProgressListener;
|
||||
|
||||
class CBrowserWindow;
|
||||
class CURIContentListener;
|
||||
class nsIContentViewer;
|
||||
class nsIClipboardCommands;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMNode;
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CBrowserShell
|
||||
@ -52,80 +51,85 @@ class nsIClipboardCommands;
|
||||
|
||||
class CBrowserShell : public LView,
|
||||
public LCommander,
|
||||
public LPeriodical,
|
||||
public LListener
|
||||
public LBroadcaster,
|
||||
public LPeriodical
|
||||
{
|
||||
|
||||
friend class CBrowserChrome;
|
||||
|
||||
private:
|
||||
typedef LView Inherited;
|
||||
typedef LView Inherited;
|
||||
|
||||
public:
|
||||
enum { class_ID = FOUR_CHAR_CODE('BroS') };
|
||||
enum { class_ID = FOUR_CHAR_CODE('BroS') };
|
||||
enum { paneID_MainBrowser = 'WebS' };
|
||||
|
||||
|
||||
CBrowserShell();
|
||||
CBrowserShell(const SPaneInfo &inPaneInfo,
|
||||
const SViewInfo &inViewInfo);
|
||||
CBrowserShell(LStream* inStream);
|
||||
CBrowserShell(const SPaneInfo &inPaneInfo,
|
||||
const SViewInfo &inViewInfo,
|
||||
UInt32 inChromeFlags,
|
||||
Boolean inIsMainContent);
|
||||
CBrowserShell(LStream* inStream);
|
||||
|
||||
virtual ~CBrowserShell();
|
||||
|
||||
virtual ~CBrowserShell();
|
||||
|
||||
|
||||
// LPane
|
||||
virtual void FinishCreateSelf();
|
||||
virtual void ResizeFrameBy(SInt16 inWidthDelta,
|
||||
SInt16 inHeightDelta,
|
||||
Boolean inRefresh);
|
||||
virtual void MoveBy(SInt32 inHorizDelta,
|
||||
SInt32 inVertDelta,
|
||||
Boolean inRefresh);
|
||||
// LPane
|
||||
virtual void FinishCreateSelf();
|
||||
virtual void ResizeFrameBy(SInt16 inWidthDelta,
|
||||
SInt16 inHeightDelta,
|
||||
Boolean inRefresh);
|
||||
virtual void MoveBy(SInt32 inHorizDelta,
|
||||
SInt32 inVertDelta,
|
||||
Boolean inRefresh);
|
||||
virtual void ShowSelf();
|
||||
virtual void DrawSelf();
|
||||
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
|
||||
virtual void EventMouseUp(const EventRecord &inMacEvent);
|
||||
|
||||
#if __PowerPlant__ >= 0x02200000
|
||||
virtual void AdjustMouseSelf(Point /* inPortPt */,
|
||||
const EventRecord& inMacEvent,
|
||||
RgnHandle outMouseRgn);
|
||||
#else
|
||||
virtual void AdjustCursorSelf(Point inPortPt,
|
||||
const EventRecord& inMacEvent);
|
||||
#endif
|
||||
virtual void DrawSelf();
|
||||
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
|
||||
virtual void EventMouseUp(const EventRecord &inMacEvent);
|
||||
|
||||
virtual void AdjustMouseSelf(Point /* inPortPt */,
|
||||
const EventRecord& inMacEvent,
|
||||
RgnHandle outMouseRgn);
|
||||
|
||||
// LCommander
|
||||
virtual void BeTarget();
|
||||
virtual void DontBeTarget();
|
||||
virtual Boolean HandleKeyPress(const EventRecord &inKeyEvent);
|
||||
// LCommander
|
||||
virtual void BeTarget();
|
||||
virtual void DontBeTarget();
|
||||
virtual Boolean HandleKeyPress(const EventRecord &inKeyEvent);
|
||||
virtual Boolean ObeyCommand(PP_PowerPlant::CommandT inCommand, void* ioParam);
|
||||
virtual void FindCommandStatus(PP_PowerPlant::CommandT inCommand,
|
||||
Boolean &outEnabled, Boolean &outUsesMark,
|
||||
UInt16 &outMark, Str255 outName);
|
||||
Boolean &outEnabled, Boolean &outUsesMark,
|
||||
UInt16 &outMark, Str255 outName);
|
||||
|
||||
// LPeriodical
|
||||
virtual void SpendTime(const EventRecord& inMacEvent);
|
||||
|
||||
// LListener
|
||||
virtual void ListenToMessage(MessageT inMessage,
|
||||
void* ioParam);
|
||||
|
||||
// CBrowserShell
|
||||
NS_METHOD SetTopLevelWindow(nsIWebBrowserChrome * aTopLevelWindow);
|
||||
NS_METHOD GetWebBrowser(nsIWebBrowser** aBrowser);
|
||||
NS_METHOD SetWebBrowser(nsIWebBrowser* aBrowser);
|
||||
// Drops ref to current one, installs given one
|
||||
|
||||
// LPeriodical
|
||||
virtual void SpendTime(const EventRecord& inMacEvent);
|
||||
|
||||
|
||||
// CBrowserShell
|
||||
|
||||
// Called by the window creator after parameterized contructor. Not used
|
||||
// when we're created from a 'PPob' resource. In that case, attachments can be
|
||||
// added with Constructor.
|
||||
virtual void AddAttachments();
|
||||
|
||||
NS_METHOD GetWebBrowser(nsIWebBrowser** aBrowser);
|
||||
NS_METHOD SetWebBrowser(nsIWebBrowser* aBrowser);
|
||||
// Drops ref to current one, installs given one
|
||||
|
||||
NS_METHOD GetWebBrowserChrome(nsIWebBrowserChrome** aChrome);
|
||||
|
||||
NS_METHOD GetContentViewer(nsIContentViewer** aViewer);
|
||||
|
||||
Boolean CanGoBack();
|
||||
Boolean CanGoForward();
|
||||
|
||||
Boolean IsBusy();
|
||||
Boolean CanGoBack();
|
||||
Boolean CanGoForward();
|
||||
|
||||
NS_METHOD Back();
|
||||
NS_METHOD Forward();
|
||||
NS_METHOD Stop();
|
||||
NS_METHOD Reload();
|
||||
|
||||
NS_METHOD LoadURL(const nsACString& urlText);
|
||||
NS_METHOD GetCurrentURL(nsACString& urlText);
|
||||
NS_METHOD Back();
|
||||
NS_METHOD Forward();
|
||||
NS_METHOD Stop();
|
||||
NS_METHOD Reload();
|
||||
|
||||
NS_METHOD LoadURL(const nsACString& urlText);
|
||||
NS_METHOD GetCurrentURL(nsACString& urlText);
|
||||
|
||||
// Puts up a Save As dialog and saves current URI and all images, etc.
|
||||
NS_METHOD SaveDocument();
|
||||
@ -134,24 +138,35 @@ public:
|
||||
// Same as above but without UI
|
||||
NS_METHOD SaveDocument(const FSSpec& destFile);
|
||||
NS_METHOD SaveCurrentURI(const FSSpec& destFile);
|
||||
|
||||
// Puts up a find dialog and does the find operation
|
||||
Boolean Find();
|
||||
// Does the find operation with the given params - no UI
|
||||
Boolean Find(const nsString& searchStr,
|
||||
|
||||
// Puts up a find dialog and does the find operation
|
||||
Boolean Find();
|
||||
// Does the find operation with the given params - no UI
|
||||
Boolean Find(const nsAString& searchStr,
|
||||
Boolean caseSensitive,
|
||||
Boolean searchBackward,
|
||||
Boolean wrapSearch,
|
||||
Boolean wholeWordOnly);
|
||||
Boolean CanFindNext();
|
||||
Boolean FindNext();
|
||||
|
||||
Boolean CanFindNext();
|
||||
Boolean FindNext();
|
||||
|
||||
protected:
|
||||
NS_METHOD OnShowContextMenu(PRUint32 aContextFlags,
|
||||
nsIDOMEvent *aEvent,
|
||||
nsIDOMNode *aNode);
|
||||
|
||||
NS_METHOD OnShowTooltip(PRInt32 aXCoords,
|
||||
PRInt32 aYCoords,
|
||||
const PRUnichar *aTipText);
|
||||
NS_METHOD OnHideTooltip();
|
||||
|
||||
|
||||
NS_METHOD CommonConstruct();
|
||||
NS_METHOD EnsureTopLevelWidget(nsIWidget **aWidget);
|
||||
|
||||
void HandleMouseMoved(const EventRecord& inMacEvent);
|
||||
void AdjustFrame();
|
||||
virtual Boolean DoFindDialog(nsString& searchText,
|
||||
virtual Boolean DoFindDialog(nsAString& searchText,
|
||||
PRBool& findBackwards,
|
||||
PRBool& wrapFind,
|
||||
PRBool& entireWord,
|
||||
@ -161,14 +176,26 @@ protected:
|
||||
NS_METHOD GetClipboardHandler(nsIClipboardCommands **aCommand);
|
||||
|
||||
Boolean HasFormElements();
|
||||
|
||||
|
||||
virtual void PostOpenURLEvent(const nsACString& url);
|
||||
|
||||
protected:
|
||||
LStr255 mInitURL;
|
||||
UInt32 mChromeFlags;
|
||||
Boolean mIsMainContent;
|
||||
|
||||
nsCOMPtr<nsIEventSink> mEventSink; // for event dispatch
|
||||
nsCOMPtr<nsIWebBrowser> mWebBrowser; // The thing we actually create
|
||||
nsCOMPtr<nsIBaseWindow> mWebBrowserAsBaseWin; // Convenience interface to above
|
||||
nsCOMPtr<nsIWebNavigation> mWebBrowserAsWebNav; // Ditto
|
||||
nsCOMPtr<nsIEventSink> mEventSink; // for event dispatch
|
||||
nsCOMPtr<nsIWebBrowser> mWebBrowser; // The thing we actually create
|
||||
nsCOMPtr<nsIBaseWindow> mWebBrowserAsBaseWin; // Convenience interface to above
|
||||
nsCOMPtr<nsIWebNavigation> mWebBrowserAsWebNav; // Ditto
|
||||
|
||||
CBrowserChrome *mChrome;
|
||||
CBrowserShellProgressListener *mProgressListener;
|
||||
|
||||
// These are stored only during OnShowContextMenu so that they can
|
||||
// be used by FindCommandStatus and ObeyCommand which get called
|
||||
// during OnShowContextMenu.
|
||||
PRUint32 mContextMenuContext;
|
||||
nsIDOMNode *mContextMenuDOMNode;
|
||||
};
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
/* -*- Mode: C++; tab-width: 4; 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
|
||||
@ -17,175 +17,68 @@
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <conrad@ingress.com>
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
*/
|
||||
|
||||
#include <LWindow.h>
|
||||
#include <LListener.h>
|
||||
|
||||
#ifndef nsError_h
|
||||
#include "nsError.h"
|
||||
#endif
|
||||
|
||||
#ifndef nsCom_h__
|
||||
#include "nsCom.h"
|
||||
#endif
|
||||
|
||||
#ifndef nsCOMPtr_h___
|
||||
#include "nsCOMPtr.h"
|
||||
#endif
|
||||
|
||||
#ifndef nscore_h___
|
||||
#include "nscore.h"
|
||||
#endif
|
||||
|
||||
#ifndef nsIWidget_h__
|
||||
#include "nsIWidget.h"
|
||||
#endif
|
||||
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include <LBroadcaster.h>
|
||||
|
||||
class CBrowserShell;
|
||||
class CWebBrowserChrome;
|
||||
class LEditText;
|
||||
class LStaticText;
|
||||
class CThrobber;
|
||||
class LBevelButton;
|
||||
class LProgressBar;
|
||||
class nsIDocumentLoader;
|
||||
class nsIURI;
|
||||
class nsIRequest;
|
||||
class nsIWebProgress;
|
||||
class CWebBrowserCMAttachment;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMNode;
|
||||
|
||||
|
||||
// CBrowserWindow:
|
||||
// A simple browser window that hooks up a CBrowserShell to a minimal set of controls
|
||||
// (Back, Forward and Stop buttons + URL field + status bar).
|
||||
|
||||
|
||||
class CBrowserWindow : public LWindow,
|
||||
public LListener,
|
||||
public LBroadcaster
|
||||
class CBrowserWindow : public LWindow,
|
||||
public LListener,
|
||||
public LBroadcaster
|
||||
{
|
||||
private:
|
||||
typedef LWindow Inherited;
|
||||
|
||||
friend class CWebBrowserChrome;
|
||||
friend class CWindowCreator;
|
||||
friend class CBrowserShell;
|
||||
|
||||
public:
|
||||
enum { class_ID = FOUR_CHAR_CODE('BroW') };
|
||||
enum { class_ID = FOUR_CHAR_CODE('BroW') };
|
||||
|
||||
CBrowserWindow();
|
||||
CBrowserWindow(LCommander* inSuperCommander,
|
||||
const Rect& inGlobalBounds,
|
||||
ConstStringPtr inTitle,
|
||||
SInt16 inProcID,
|
||||
UInt32 inAttributes,
|
||||
WindowPtr inBehind,
|
||||
Boolean inIsChromeWindow);
|
||||
CBrowserWindow(LStream* inStream);
|
||||
CBrowserWindow(LCommander* inSuperCommander,
|
||||
const Rect& inGlobalBounds,
|
||||
ConstStringPtr inTitle,
|
||||
SInt16 inProcID,
|
||||
UInt32 inAttributes,
|
||||
WindowPtr inBehind);
|
||||
CBrowserWindow(LStream* inStream);
|
||||
|
||||
virtual ~CBrowserWindow();
|
||||
virtual ~CBrowserWindow();
|
||||
|
||||
static CBrowserWindow* CreateWindow(PRUint32 chromeFlags, PRInt32 width, PRInt32 height);
|
||||
virtual void FinishCreateSelf();
|
||||
|
||||
virtual void FinishCreate();
|
||||
virtual void FinishCreateSelf();
|
||||
virtual void ResizeFrameBy(SInt16 inWidthDelta,
|
||||
SInt16 inHeightDelta,
|
||||
Boolean inRefresh);
|
||||
virtual void ShowSelf();
|
||||
|
||||
virtual void ListenToMessage(MessageT inMessage,
|
||||
void* ioParam);
|
||||
virtual void ListenToMessage(MessageT inMessage,
|
||||
void* ioParam);
|
||||
|
||||
virtual Boolean ObeyCommand(CommandT inCommand,
|
||||
void *ioParam);
|
||||
|
||||
virtual void FindCommandStatus(PP_PowerPlant::CommandT inCommand,
|
||||
Boolean &outEnabled,
|
||||
Boolean &outUsesMark,
|
||||
UInt16 &outMark,
|
||||
Str255 outName);
|
||||
|
||||
NS_METHOD GetWidget(nsIWidget** aWidget);
|
||||
CBrowserShell* GetBrowserShell() const
|
||||
{ return mBrowserShell; }
|
||||
|
||||
void SetSizeToContent(Boolean isSizedToContent)
|
||||
{ mSizeToContent = isSizedToContent; }
|
||||
Boolean GetSizeToContent()
|
||||
{ return mSizeToContent; }
|
||||
NS_METHOD SizeToContent();
|
||||
|
||||
NS_METHOD Stop();
|
||||
Boolean IsBusy()
|
||||
{ return mBusy; }
|
||||
|
||||
virtual Boolean ObeyCommand(CommandT inCommand,
|
||||
void *ioParam);
|
||||
|
||||
protected:
|
||||
|
||||
// Called by both constructors
|
||||
NS_METHOD CommonConstruct();
|
||||
|
||||
// -----------------------------------
|
||||
// Methods called by CWebBrowserChrome
|
||||
// -----------------------------------
|
||||
|
||||
NS_METHOD SetStatus(const PRUnichar* aStatus);
|
||||
NS_METHOD SetOverLink(const PRUnichar* aStatus)
|
||||
{ return SetStatus(aStatus); }
|
||||
|
||||
NS_METHOD SetLocation(const nsString& aLocation);
|
||||
|
||||
NS_METHOD OnStatusNetStart(nsIWebProgress *progress, nsIRequest *request,
|
||||
PRInt32 progressStateFlags, PRUint32 status);
|
||||
NS_METHOD OnStatusNetStop(nsIWebProgress *progress, nsIRequest *request,
|
||||
PRInt32 progressStateFlags, PRUint32 status);
|
||||
|
||||
NS_METHOD OnProgressChange(nsIWebProgress *progress, nsIRequest *request,
|
||||
PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
|
||||
PRInt32 curTotalProgress, PRInt32 maxTotalProgress);
|
||||
CBrowserShell* mBrowserShell;
|
||||
|
||||
NS_METHOD GetVisibility(PRBool *aVisibility);
|
||||
NS_METHOD SetVisibility(PRBool aVisibility);
|
||||
|
||||
NS_METHOD OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode);
|
||||
|
||||
NS_METHOD GetIWebBrowserChrome(nsIWebBrowserChrome **aChrome);
|
||||
|
||||
// -----------------------------------
|
||||
// Internal
|
||||
// -----------------------------------
|
||||
|
||||
NS_METHOD SetTitleFromDOMDocument();
|
||||
void SendOpenURLEventToSelf(const nsACString& url);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIWidget> mWindow;
|
||||
|
||||
Boolean mIsChromeWindow;
|
||||
CBrowserShell* mBrowserShell;
|
||||
CWebBrowserChrome* mBrowserChrome;
|
||||
LEditText* mURLField;
|
||||
LStaticText* mStatusBar;
|
||||
CThrobber* mThrobber;
|
||||
LControl *mBackButton, *mForwardButton, *mReloadButton, *mStopButton;
|
||||
LProgressBar* mProgressBar;
|
||||
Boolean mBusy;
|
||||
Boolean mInitialLoadComplete;
|
||||
Boolean mVisible; // whether we are visible according to Get/SetVisibility
|
||||
Boolean mSizeToContent;
|
||||
|
||||
PRUint32 mContextMenuContext;
|
||||
nsIDOMNode* mContextMenuDOMNode; // weak ref - only kept during call of OnShowContextMenu
|
||||
LEditText* mURLField;
|
||||
LStaticText* mStatusBar;
|
||||
CThrobber* mThrobber;
|
||||
LControl *mBackButton, *mForwardButton, *mReloadButton, *mStopButton;
|
||||
LProgressBar* mProgressBar;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Global Functions
|
||||
// Global Functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Must be called at initialization time - after NS_InitEmbedding
|
||||
|
@ -17,179 +17,80 @@
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <conrad@ingress.com>
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
*/
|
||||
|
||||
#include "CThrobber.h"
|
||||
#include "CBrowserWindow.h"
|
||||
|
||||
#include <LString.h>
|
||||
#include <LStream.h>
|
||||
#include <UDrawingState.h>
|
||||
#include <UResourceMgr.h>
|
||||
|
||||
#include "nsIWidget.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsFont.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "prprf.h"
|
||||
|
||||
// CIDs
|
||||
static NS_DEFINE_IID(kChildCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
// Static variables
|
||||
map<nsIWidget*, CThrobber*> CThrobber::mgThrobberMap;
|
||||
|
||||
// Constants
|
||||
const PRUint32 kThrobFrequency = 66; // animation frequency in milliseconds
|
||||
#include <QuickTimeComponents.h>
|
||||
|
||||
//*****************************************************************************
|
||||
//*** CThrobber: constructors/destructor
|
||||
//*****************************************************************************
|
||||
|
||||
CThrobber::CThrobber() :
|
||||
mNumImages(2), mCompletedImages(0), mRunning(false)
|
||||
mMovieResID(-1), mMovieHandle(nil),
|
||||
mMovie(nil), mMovieController(nil)
|
||||
{
|
||||
NS_INIT_REFCNT(); // caller must add ref as normal
|
||||
|
||||
AddThrobber(this);
|
||||
}
|
||||
|
||||
|
||||
CThrobber::CThrobber(LStream* inStream) :
|
||||
LControl(inStream),
|
||||
mNumImages(2), mCompletedImages(0), mRunning(false)
|
||||
mMovieResID(-1), mMovieHandle(nil),
|
||||
mMovie(nil), mMovieController(nil)
|
||||
{
|
||||
mRefCnt = 1; // PowerPlant is making us, and it sure isn't going to do an AddRef.
|
||||
|
||||
LStr255 tempStr;
|
||||
|
||||
mDefImageURL[0] = '\0';
|
||||
*inStream >> (StringPtr) tempStr;
|
||||
memcpy(mDefImageURL, (char *)&tempStr[1], (PRInt32)tempStr.Length());
|
||||
mDefImageURL[(PRInt32)tempStr.Length()] = '\0';
|
||||
|
||||
mAnimImageURL[0] = '\0';
|
||||
*inStream >> (StringPtr) tempStr;
|
||||
memcpy(mAnimImageURL, (char *)&tempStr[1], (PRInt32)tempStr.Length());
|
||||
mAnimImageURL[(PRInt32)tempStr.Length()] = '\0';
|
||||
*inStream >> mMovieResID;
|
||||
}
|
||||
|
||||
|
||||
CThrobber::~CThrobber()
|
||||
{
|
||||
if (mWidget)
|
||||
mWidget->Destroy();
|
||||
DestroyImages();
|
||||
RemoveThrobber(this);
|
||||
if (mMovieController)
|
||||
::DisposeMovieController(mMovieController);
|
||||
if (mMovieHandle)
|
||||
::DisposeHandle(mMovieHandle);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS0(CThrobber)
|
||||
|
||||
|
||||
#if 0
|
||||
void CThrobber::Notify(nsIImageRequest *aImageRequest,
|
||||
nsIImage *aImage,
|
||||
nsImageNotification aNotificationType,
|
||||
PRInt32 aParam1, PRInt32 aParam2,
|
||||
void *aParam3)
|
||||
{
|
||||
if (aNotificationType == nsImageNotification_kImageComplete)
|
||||
{
|
||||
mCompletedImages++;
|
||||
|
||||
// Remove ourselves as an observer of the image request object, because
|
||||
// the image request objects each hold a reference to us. This avoids a
|
||||
// circular reference problem. If we don't, our ref count will never reach
|
||||
// 0 and we won't get destroyed and neither will the image request objects
|
||||
|
||||
aImageRequest->RemoveObserver((nsIImageRequestObserver*)this);
|
||||
}
|
||||
}
|
||||
|
||||
void CThrobber::NotifyError(nsIImageRequest *aImageRequest,
|
||||
nsImageError aErrorType)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CThrobber::FinishCreateSelf()
|
||||
{
|
||||
CBrowserWindow *ourWindow = dynamic_cast<CBrowserWindow*>(LWindow::FetchWindowObject(Compat_GetMacWindow()));
|
||||
ThrowIfNil_(ourWindow);
|
||||
|
||||
// Get the widget from the browser window
|
||||
nsCOMPtr<nsIWidget> parentWidget;
|
||||
ourWindow->GetWidget(getter_AddRefs(parentWidget));
|
||||
ThrowIfNil_(parentWidget);
|
||||
|
||||
FocusDraw();
|
||||
|
||||
Rect portFrame;
|
||||
CalcPortFrameRect(portFrame);
|
||||
nsRect r(portFrame.left, portFrame.top, portFrame.right - portFrame.left, portFrame.bottom - portFrame.top);
|
||||
|
||||
// Create widget
|
||||
nsresult rv;
|
||||
|
||||
mWidget = do_CreateInstance(kChildCID, &rv);
|
||||
if (!mWidget)
|
||||
Throw_(NS_ERROR_GET_CODE(rv));
|
||||
mWidget->Create(parentWidget, r, HandleThrobberEvent, NULL);
|
||||
|
||||
rv = LoadImages();
|
||||
if (NS_SUCCEEDED(rv))
|
||||
AddThrobber(this);
|
||||
CreateMovie();
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::ShowSelf()
|
||||
{
|
||||
mWidget->Show(PR_TRUE);
|
||||
LControl::ShowSelf();
|
||||
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
::MCSetClip(mMovieController, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::HideSelf()
|
||||
{
|
||||
mWidget->Show(PR_FALSE);
|
||||
LControl::HideSelf();
|
||||
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
StRegion emptyRgn;
|
||||
::MCSetClip(mMovieController, NULL, emptyRgn);
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::DrawSelf()
|
||||
{
|
||||
#if 0
|
||||
// Draw directly with the rendering context instead of passing an
|
||||
// update event through event sink. By the time this routine is
|
||||
// called, PowerPlant has taken care of the location, z order, and clipping
|
||||
// of each view. Since focusing puts the the origin at our top left corner,
|
||||
// all we have to do is get the bounds of the widget and put that at (0,0)
|
||||
|
||||
StColorPortState origState(UQDGlobals::GetCurrentPort());
|
||||
|
||||
nsCOMPtr<nsIRenderingContext> cx = getter_AddRefs(mWidget->GetRenderingContext());
|
||||
nsRect bounds;
|
||||
nsIImageRequest *imgreq;
|
||||
nsIImage *img;
|
||||
|
||||
mWidget->GetClientBounds(bounds);
|
||||
bounds.x = bounds.y = 0;
|
||||
|
||||
//cx->SetClipRect(bounds, nsClipCombine_kReplace, clipState);
|
||||
|
||||
PRUint32 index = mRunning ? kAnimImageIndex : kDefaultImageIndex;
|
||||
imgreq = index < mImages->size() ? (*mImages)[index] : nsnull;
|
||||
img = imgreq ? imgreq->GetImage() : nsnull;
|
||||
|
||||
if (img)
|
||||
{
|
||||
cx->DrawImage(img, 0, 0);
|
||||
NS_RELEASE(img);
|
||||
}
|
||||
#endif
|
||||
if (mMovieController)
|
||||
::MCDraw(mMovieController, Compat_GetMacWindow());
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +99,17 @@ void CThrobber::ResizeFrameBy(SInt16 inWidthDelta,
|
||||
Boolean inRefresh)
|
||||
{
|
||||
LControl::ResizeFrameBy(inWidthDelta, inHeightDelta, inRefresh);
|
||||
AdjustFrame(inRefresh);
|
||||
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
FocusDraw();
|
||||
|
||||
Rect newFrame;
|
||||
::MCGetControllerBoundsRect(mMovieController, &newFrame);
|
||||
newFrame.right += inWidthDelta;
|
||||
newFrame.bottom += inHeightDelta;
|
||||
::MCSetControllerBoundsRect(mMovieController, &newFrame);
|
||||
}
|
||||
|
||||
|
||||
@ -207,191 +118,97 @@ void CThrobber::MoveBy(SInt32 inHorizDelta,
|
||||
Boolean inRefresh)
|
||||
{
|
||||
LControl::MoveBy(inHorizDelta, inVertDelta, inRefresh);
|
||||
AdjustFrame(inRefresh);
|
||||
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
FocusDraw();
|
||||
|
||||
Rect newFrame;
|
||||
::MCGetControllerBoundsRect(mMovieController, &newFrame);
|
||||
::OffsetRect(&newFrame, inHorizDelta, inVertDelta);
|
||||
::MCSetControllerBoundsRect(mMovieController, &newFrame);
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::SpendTime(const EventRecord &inMacEvent)
|
||||
{
|
||||
FocusDraw();
|
||||
::MCIsPlayerEvent(mMovieController, &inMacEvent);
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::Start()
|
||||
{
|
||||
mRunning = true;
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
::StartMovie(mMovie);
|
||||
StartRepeating();
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::Stop()
|
||||
{
|
||||
mRunning = false;
|
||||
FocusDraw();
|
||||
mWidget->Invalidate(PR_TRUE);
|
||||
if (!mMovieController)
|
||||
return;
|
||||
|
||||
StopRepeating();
|
||||
::StopMovie(mMovie);
|
||||
::GoToBeginningOfMovie(mMovie);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::AdjustFrame(Boolean inRefresh)
|
||||
void CThrobber::CreateMovie()
|
||||
{
|
||||
FocusDraw();
|
||||
OSErr err;
|
||||
Handle dataRef = NULL;
|
||||
|
||||
try {
|
||||
// Get the movie from our resource
|
||||
StApplicationContext appResContext;
|
||||
|
||||
mMovieHandle = ::Get1Resource('GIF ', 128);
|
||||
ThrowIfResFail_(mMovieHandle);
|
||||
::DetachResource(mMovieHandle);
|
||||
|
||||
// Create a dataRef handle - from TN2018
|
||||
err = ::PtrToHand(&mMovieHandle, &dataRef, sizeof(Handle));
|
||||
ThrowIfError_(err);
|
||||
err = ::PtrAndHand("\p", dataRef, 1);
|
||||
ThrowIfError_(err);
|
||||
long fileTypeAtom[3];
|
||||
fileTypeAtom[0] = sizeof(long) * 3;
|
||||
fileTypeAtom[1] = kDataRefExtensionMacOSFileType;
|
||||
fileTypeAtom[2] = kQTFileTypeGIF;
|
||||
err = ::PtrAndHand(fileTypeAtom, dataRef, sizeof(long) * 3);
|
||||
ThrowIfError_(err);
|
||||
|
||||
err = ::NewMovieFromDataRef(&mMovie, newMovieActive, NULL, dataRef, HandleDataHandlerSubType);
|
||||
ThrowIfError_(err);
|
||||
DisposeHandle(dataRef);
|
||||
dataRef = NULL;
|
||||
|
||||
// Make a controller for the movie
|
||||
Rect movieBounds;
|
||||
::GetMovieBox(mMovie, &movieBounds);
|
||||
::MacOffsetRect(&movieBounds, (SInt16) -movieBounds.left, (SInt16) -movieBounds.top);
|
||||
::SetMovieBox(mMovie, &movieBounds);
|
||||
|
||||
Rect portFrame;
|
||||
CalcPortFrameRect(portFrame);
|
||||
nsRect r(portFrame.left, portFrame.top, portFrame.right - portFrame.left, portFrame.bottom - portFrame.top);
|
||||
|
||||
mWidget->Resize(r.x, r.y, r.width, r.height, inRefresh);
|
||||
}
|
||||
::SetMovieGWorld(mMovie, (CGrafPtr) GetMacPort(), nil);
|
||||
|
||||
|
||||
NS_METHOD CThrobber::LoadImages()
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
#if 0
|
||||
mImages = new vector<nsIImageRequest*>(mNumImages, nsnull);
|
||||
if (nsnull == mImages) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
rv = NS_NewImageGroup(&mImageGroup);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsIDeviceContext *deviceCtx = mWidget->GetDeviceContext();
|
||||
mImageGroup->Init(deviceCtx, nsnull);
|
||||
NS_RELEASE(deviceCtx);
|
||||
|
||||
mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
mTimer->Init(ThrobTimerCallback, this, kThrobFrequency, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_SLACK);
|
||||
|
||||
nscolor bgcolor = NS_RGB(0, 0, 0);
|
||||
|
||||
// Get the default image
|
||||
if (strlen(mDefImageURL)) {
|
||||
(*mImages)[kDefaultImageIndex] = mImageGroup->GetImage(mDefImageURL,
|
||||
(nsIImageRequestObserver *)this,
|
||||
nsnull /*&bgcolor*/,
|
||||
mFrameSize.width,
|
||||
mFrameSize.height, 0);
|
||||
}
|
||||
|
||||
// Get the animated image
|
||||
if (strlen(mAnimImageURL)) {
|
||||
(*mImages)[kAnimImageIndex] = mImageGroup->GetImage(mAnimImageURL,
|
||||
(nsIImageRequestObserver *)this,
|
||||
nsnull /*&bgcolor*/,
|
||||
mFrameSize.width,
|
||||
mFrameSize.height, 0);
|
||||
}
|
||||
|
||||
mWidget->Invalidate(PR_TRUE);
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void CThrobber::DestroyImages()
|
||||
{
|
||||
if (mTimer)
|
||||
{
|
||||
mTimer->Cancel();
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (mImageGroup)
|
||||
{
|
||||
mImageGroup->Interrupt();
|
||||
|
||||
for (vector<nsIImageRequest*>::iterator iter = mImages->begin(); iter < mImages->end(); ++iter)
|
||||
{
|
||||
NS_IF_RELEASE(*iter);
|
||||
Rect frame;
|
||||
CalcLocalFrameRect(frame);
|
||||
mMovieController = ::NewMovieController(mMovie, &frame, mcTopLeftMovie + mcNotVisible);
|
||||
|
||||
::MCDoAction(mMovieController, mcActionSetLooping, (void *)1);
|
||||
::MCMovieChanged(mMovieController, mMovie);
|
||||
}
|
||||
catch (...) {
|
||||
if (dataRef)
|
||||
DisposeHandle(dataRef);
|
||||
|
||||
// Don't rethrow
|
||||
}
|
||||
NS_RELEASE(mImageGroup);
|
||||
}
|
||||
|
||||
if (mImages)
|
||||
{
|
||||
delete mImages;
|
||||
mImages = nsnull;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CThrobber::Tick()
|
||||
{
|
||||
if (mRunning) {
|
||||
FocusDraw();
|
||||
mWidget->Invalidate(PR_TRUE);
|
||||
} else if (mCompletedImages == (PRUint32)mNumImages) {
|
||||
FocusDraw();
|
||||
mWidget->Invalidate(PR_TRUE);
|
||||
mCompletedImages = 0;
|
||||
}
|
||||
|
||||
#ifndef REPEATING_TIMERS
|
||||
nsresult rv;
|
||||
mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
if (NS_OK == rv) {
|
||||
mTimer->Init(ThrobTimerCallback, this, kThrobFrequency);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
CThrobber* CThrobber::FindThrobberForWidget(nsIWidget* aWidget)
|
||||
{
|
||||
map<nsIWidget*, CThrobber*>::iterator iter = mgThrobberMap.find(aWidget);
|
||||
if (iter == mgThrobberMap.end())
|
||||
return nsnull;
|
||||
else
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::AddThrobber(CThrobber* aThrobber)
|
||||
{
|
||||
pair<nsIWidget*, CThrobber*> entry(aThrobber->mWidget, aThrobber);
|
||||
mgThrobberMap[aThrobber->mWidget] = aThrobber;
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::RemoveThrobber(CThrobber* aThrobber)
|
||||
{
|
||||
map<nsIWidget*, CThrobber*>::iterator iter = mgThrobberMap.find(aThrobber->mWidget);
|
||||
if (iter != mgThrobberMap.end())
|
||||
mgThrobberMap.erase(iter);
|
||||
}
|
||||
|
||||
|
||||
nsEventStatus PR_CALLBACK CThrobber::HandleThrobberEvent(nsGUIEvent *aEvent)
|
||||
{
|
||||
CThrobber* throbber = FindThrobberForWidget(aEvent->widget);
|
||||
if (nsnull == throbber) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
switch (aEvent->message)
|
||||
{
|
||||
case NS_PAINT:
|
||||
break;
|
||||
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
// Broadcast a message
|
||||
break;
|
||||
|
||||
case NS_MOUSE_ENTER:
|
||||
aEvent->widget->SetCursor(eCursor_hyperlink);
|
||||
break;
|
||||
|
||||
case NS_MOUSE_EXIT:
|
||||
aEvent->widget->SetCursor(eCursor_standard);
|
||||
break;
|
||||
}
|
||||
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
|
||||
void CThrobber::ThrobTimerCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
CThrobber* throbber = (CThrobber*)aClosure;
|
||||
throbber->Tick();
|
||||
}
|
||||
|
@ -17,89 +17,57 @@
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <conrad@ingress.com>
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef __CThrobber__
|
||||
#define __CThrobber__
|
||||
|
||||
#include <LControl.h>
|
||||
|
||||
#ifndef nsError_h
|
||||
#include "nsError.h"
|
||||
#endif
|
||||
|
||||
#ifndef nsCOMPtr_h___
|
||||
#include "nsCOMPtr.h"
|
||||
#endif
|
||||
|
||||
#ifndef nsGUIEvent_h__
|
||||
#include "nsGUIEvent.h"
|
||||
#endif
|
||||
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
class nsIWidget;
|
||||
#include <LPeriodical.h>
|
||||
|
||||
// ToolBox
|
||||
#include <Movies.h>
|
||||
|
||||
class CThrobber : public LControl,
|
||||
public nsISupports
|
||||
public LPeriodical
|
||||
{
|
||||
public:
|
||||
enum { class_ID = FOUR_CHAR_CODE('Thrb') };
|
||||
|
||||
CThrobber();
|
||||
CThrobber(LStream* inStream);
|
||||
|
||||
virtual ~CThrobber();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
CThrobber();
|
||||
CThrobber(LStream* inStream);
|
||||
|
||||
virtual ~CThrobber();
|
||||
|
||||
// LPane
|
||||
virtual void FinishCreateSelf();
|
||||
virtual void ShowSelf();
|
||||
virtual void HideSelf();
|
||||
virtual void DrawSelf();
|
||||
|
||||
void ResizeFrameBy(SInt16 inWidthDelta,
|
||||
SInt16 inHeightDelta,
|
||||
Boolean inRefresh);
|
||||
void MoveBy(SInt32 inHorizDelta,
|
||||
SInt32 inVertDelta,
|
||||
Boolean inRefresh);
|
||||
|
||||
// LPeriodical
|
||||
virtual void SpendTime(const EventRecord &inMacEvent);
|
||||
|
||||
// CThrobber
|
||||
virtual void FinishCreateSelf();
|
||||
virtual void ShowSelf();
|
||||
virtual void HideSelf();
|
||||
virtual void DrawSelf();
|
||||
|
||||
void ResizeFrameBy(SInt16 inWidthDelta,
|
||||
SInt16 inHeightDelta,
|
||||
Boolean inRefresh);
|
||||
void MoveBy(SInt32 inHorizDelta,
|
||||
SInt32 inVertDelta,
|
||||
Boolean inRefresh);
|
||||
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
protected:
|
||||
|
||||
enum { kDefaultImageIndex = 0, kAnimImageIndex };
|
||||
|
||||
void AdjustFrame(Boolean inRefresh);
|
||||
nsresult LoadImages();
|
||||
void DestroyImages();
|
||||
void Tick();
|
||||
|
||||
char mDefImageURL[256], mAnimImageURL[256];
|
||||
|
||||
nsCOMPtr<nsIWidget> mWidget;
|
||||
// vector<nsIImageRequest*> *mImages;
|
||||
bool mRunning;
|
||||
SInt32 mNumImages, mCompletedImages;
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
|
||||
static map<nsIWidget*, CThrobber*> mgThrobberMap;
|
||||
|
||||
static CThrobber* FindThrobberForWidget(nsIWidget* aWidget);
|
||||
static void AddThrobber(CThrobber* aThrobber);
|
||||
static void RemoveThrobber(CThrobber* aThrobber);
|
||||
static nsEventStatus PR_CALLBACK HandleThrobberEvent(nsGUIEvent *aEvent);
|
||||
static void ThrobTimerCallback(nsITimer *aTimer, void *aClosure);
|
||||
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
|
||||
protected:
|
||||
void CreateMovie();
|
||||
|
||||
protected:
|
||||
SInt16 mMovieResID;
|
||||
Handle mMovieHandle;
|
||||
Movie mMovie;
|
||||
MovieController mMovieController;
|
||||
};
|
||||
|
||||
|
||||
|
@ -25,6 +25,31 @@
|
||||
#ifndef __PPEmbedConfig_h
|
||||
#define __PPEmbedConfig_h
|
||||
|
||||
#define USE_PROFILES 1
|
||||
/*
|
||||
USE_PROFILES
|
||||
|
||||
If defined, the application will use nsIProfileManager to allow
|
||||
distinct user profiles. It also demonstrates dynamic profile switching in this case.
|
||||
|
||||
If undefined, the application will construct and register an
|
||||
nsIDirectoryServiceProvider which provides profile-relative file locations to one
|
||||
fixed directory.
|
||||
*/
|
||||
|
||||
#define USE_PROFILES
|
||||
|
||||
/*
|
||||
NATIVE_PROMPTS
|
||||
|
||||
If defined, the application will override Gecko's prompt service
|
||||
component with the implementation in PromptService.cpp. This implementation uses
|
||||
PowerPlant dialogs.
|
||||
|
||||
If undefined, the application will use Gecko's default prompt service. This implementation
|
||||
creates chrome dialogs through the nsIWindowCreator interface. Undefining this
|
||||
is useful for testing the implementation of nsIWindowCreator, nsIWebBrowserChrome, etc.
|
||||
*/
|
||||
|
||||
#define NATIVE_PROMPTS
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user