Browse Source

checking in lots of changes for binaryc

import/tags/kmeleon03
spaetz 22 years ago
parent
commit
cbd505e361
  1. 42
      k-meleon/KMeleon.cpp
  2. 46
      k-meleon/KMeleon.dsp
  3. 24
      k-meleon/KMeleon.dsw
  4. 11
      k-meleon/KMeleon.h
  5. 209
      k-meleon/KMeleon.rc
  6. 117
      k-meleon/MainFrm.cpp
  7. 32
      k-meleon/MainFrm.h
  8. 3
      k-meleon/MainToolBar.cpp
  9. 26
      k-meleon/Mozilla.cpp
  10. 162
      k-meleon/WebBrowserChrome.cpp
  11. 20
      k-meleon/WebBrowserChrome.h
  12. 46
      k-meleon/res/menus.txt
  13. 31
      k-meleon/resource.h

42
k-meleon/KMeleon.cpp

@ -52,7 +52,7 @@ END_MESSAGE_MAP()
CKMeleonApp::CKMeleonApp()
{
m_bBackgroundImage = TRUE;
preferences = NULL;
}
CKMeleonApp::~CKMeleonApp()
@ -110,6 +110,8 @@ BOOL CKMeleonApp::InitInstance()
NS_InitEmbedding(nsnull,nsnull);
plugins.FindAndLoad("kmeleon_*.dll");
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
@ -121,6 +123,22 @@ BOOL CKMeleonApp::InitInstance()
RUNTIME_CLASS(CMozilla));
AddDocTemplate(pDocTemplate);
/*
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CKMeleonDoc),
RUNTIME_CLASS(CMainFrame), // main MDI frame window
RUNTIME_CLASS(CMozilla));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CFrameWnd* pMainFrame = new CFrameWnd;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
*/
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
@ -131,10 +149,14 @@ BOOL CKMeleonApp::InitInstance()
CMainFrame *m=(CMainFrame *)m_pMainWnd;
CMozilla *p=(CMozilla *)m->GetActiveView();
p->createBrowser();
m_sStartPage = GetProfileString("Settings","StartPage","http://kmeleon.org/");
p->Navigate(&m_sStartPage);
if (preferences->bStartHome){
p->Navigate(&preferences->homePage);
}else{
p->Navigate(&(CString)_T("about:blank"));
}
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
@ -145,12 +167,10 @@ BOOL CKMeleonApp::InitInstance()
void CKMeleonApp::LoadCustomState ()
{
m_bBackgroundImage = GetInt (_T("BackgroundImage"), TRUE);
}
void CKMeleonApp::SaveCustomState ()
{
WriteInt (_T("BackgroundImage"), m_bBackgroundImage);
}
void CKMeleonApp::createNewBrowser()
@ -245,8 +265,18 @@ BOOL CAboutDlg::OnInitDialog()
int CKMeleonApp::ExitInstance()
{
WriteProfileString("Settings","StartPage",m_sStartPage);
if (preferences)
delete preferences;
NS_TermEmbedding();
BCGCBCleanUp ();
return CWinApp::ExitInstance();
}
BOOL CKMeleonApp::OnIdle( LONG count ){
CWinApp::OnIdle( count );
NS_DoIdleEmbeddingStuff();
return true;
}

46
k-meleon/KMeleon.dsp

@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 xpcom.lib baseembed_s.lib appfilelocprovider_s.lib plc4.lib BCGCB474StaticS.lib /nologo /subsystem:windows /machine:I386 /out:"Release/k-meleon.exe" /libpath:"..\mozilla\mozilla\dist\WIN32_O.OBJ\lib" /OPT:nowin98
# ADD LINK32 xpcom.lib baseembed_s.lib plc4.lib /nologo /subsystem:windows /machine:I386 /out:"c:/projects/mozilla/mozilla/dist/win32_o.obj/bin/k-meleon.exe" /libpath:"..\mozilla\mozilla\dist\WIN32_O.OBJ\lib" /OPT:nowin98
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "KMeleon - Win32 Debug"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\mozilla\mozilla\nsprpub\pr\include" /I "..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\mozilla\mozilla\include" /I "..\mozilla\mozilla\xpcom\components" /I "..\mozilla\mozilla\dist\include" /I "..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "_BCGCONTROLBAR_STATIC_" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /FR /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\mozilla\mozilla\nsprpub\pr\include" /I "..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\mozilla\mozilla\include" /I "..\mozilla\mozilla\xpcom\components" /I "..\mozilla\mozilla\dist\include" /I "..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /FR /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 xpcom.lib baseembed_s.lib appfilelocprovider_s.lib plc4.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/k-meleon.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_D.OBJ\lib"
# ADD LINK32 xpcom.lib baseembed_s.lib /nologo /subsystem:windows /debug /machine:I386 /out:"c:/projects/mozilla/mozilla/dist/win32_o.obj/bin/k-meleon_d.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
!ENDIF
@ -121,10 +121,26 @@ SOURCE=.\MainToolBar.cpp
# End Source File
# Begin Source File
SOURCE=.\MenuParser.cpp
# End Source File
# Begin Source File
SOURCE=.\Mozilla.cpp
# End Source File
# Begin Source File
SOURCE=.\Plugins.cpp
# End Source File
# Begin Source File
SOURCE=.\Preferences.cpp
# End Source File
# Begin Source File
SOURCE=.\Prompt.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
@ -142,6 +158,10 @@ SOURCE=.\KMeleon.h
# End Source File
# Begin Source File
SOURCE=.\kmeleon_plugin.h
# End Source File
# Begin Source File
SOURCE=.\KMeleonDoc.h
# End Source File
# Begin Source File
@ -162,10 +182,26 @@ SOURCE=.\MainToolBar.h
# End Source File
# Begin Source File
SOURCE=.\MenuParser.h
# End Source File
# Begin Source File
SOURCE=.\Mozilla.h
# End Source File
# Begin Source File
SOURCE=.\Plugins.h
# End Source File
# Begin Source File
SOURCE=.\Preferences.h
# End Source File
# Begin Source File
SOURCE=.\Prompt.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
@ -174,6 +210,10 @@ SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\UnknownFile.h
# End Source File
# Begin Source File
SOURCE=.\WebBrowserChrome.h
# End Source File
# End Group

24
k-meleon/KMeleon.dsw

@ -15,6 +15,30 @@ Package=<4>
###############################################################################
Project: "kmeleon_winamp"=".\kmeleon_winamp\kmeleon_winamp.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ns_bookmarks"=".\ns_bookmarks\ns_bookmarks.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>

11
k-meleon/KMeleon.h

@ -32,6 +32,9 @@
#include "resource.h" // main symbols
#include "Preferences.h"
#include "Plugins.h"
/////////////////////////////////////////////////////////////////////////////
// CKMeleonApp:
//
@ -42,9 +45,9 @@ class CKMeleonApp : public CWinApp,
public:
CKMeleonApp();
~CKMeleonApp();
BOOL m_bBackgroundImage;
CString m_sStartPage;
CPreferences *preferences;
CPlugins plugins;
// Overrides
// ClassWizard generated virtual function overrides
@ -59,6 +62,8 @@ public:
void createNewBrowser();
virtual BOOL OnIdle( LONG count );
// Implementation
//{{AFX_MSG(CKMeleonApp)
afx_msg void OnAppAbout();

209
k-meleon/KMeleon.rc

@ -122,7 +122,7 @@ BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "Open &new window...\tCtrl+N", ID_FILE_NEWWINDOW
MENUITEM "&New window\tCtrl+N", ID_FILE_NEWWINDOW
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM SEPARATOR
@ -147,8 +147,8 @@ BEGIN
MENUITEM "Sto&p\tEsc", ID_VIEW_STOP
MENUITEM "&Refresh\tF5", ID_VIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "&Background Image", ID_VIEW_BACKGROUND
MENUITEM "&Customize...", ID_VIEW_CUSTOMIZE
MENUITEM "&Preferences...", ID_VIEW_PREFERENCES
END
POPUP "&Go"
BEGIN
@ -179,20 +179,20 @@ END
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEWWINDOW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"N", ID_FILE_NEWWINDOW, VIRTKEY, CONTROL, NOINVERT
"O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
"P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT
"S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
END
@ -201,15 +201,15 @@ END
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 220, 79
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 219, 89
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About K-Meleon"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,162,58,50,14,WS_GROUP
DEFPUSHBUTTON "OK",IDOK,162,69,50,14,WS_GROUP
LTEXT "Toolbars rendering using",IDC_STATIC,8,55,78,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,42,205,1
CTEXT "K-Meleon v0.2.1",IDC_STATIC,84,6,54,8,SS_NOPREFIX
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,42,205,1
CTEXT "K-Meleon v0.2.1",IDC_STATIC,83,6,53,8,SS_NOPREFIX
LTEXT "Copyright © 2000",IDC_STATIC,53,17,56,8
CONTROL "Christophe Thibault",IDC_MAIL,"Button",BS_OWNERDRAW |
WS_TABSTOP,111,16,65,8
@ -221,7 +221,8 @@ BEGIN
CONTROL "BCG Library",IDC_URL_BCG,"Button",BS_OWNERDRAW |
WS_TABSTOP,87,54,41,8
LTEXT "Little corner animation by Frédéric Toussaint",
IDC_STATIC,7,64,139,8
IDC_STATIC,7,66,139,8
LTEXT "Additional Coding: Brian Harris",IDC_STATIC,7,75,96,8
END
IDR_MAINFRAME DIALOG DISCARDABLE 0, 0, 330, 16
@ -231,6 +232,92 @@ BEGIN
LTEXT "TODO: layout dialog bar ",IDC_STATIC,12,4,300,8
END
IDD_PROMPT DIALOG DISCARDABLE 0, 0, 264, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,75,74,50,14
PUSHBUTTON "Cancel",IDCANCEL,131,74,50,14
EDITTEXT IDC_EDITBOX,7,44,250,14,ES_AUTOHSCROLL
LTEXT "Static",IDC_CAPTION,7,7,250,35
END
IDD_PROMPT_USERNAME_PASSWORD DIALOG DISCARDABLE 0, 0, 186, 102
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,43,81,50,14
PUSHBUTTON "Cancel",IDCANCEL,97,81,50,14
EDITTEXT IDC_EDIT_USERNAME,61,37,118,14,ES_AUTOHSCROLL
LTEXT "Username:",IDC_STATIC,7,40,54,8
EDITTEXT IDC_EDIT_PASSWORD,61,55,118,14,ES_AUTOHSCROLL
LTEXT "Password",IDC_STATIC,7,58,54,8
LTEXT "Static",IDC_CAPTION,7,7,172,26
END
IDD_PREFERENCES DIALOGEX 0, 0, 345, 185
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
CAPTION "Preferences"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,234,164,50,14
PUSHBUTTON "Cancel",IDCANCEL,288,164,50,14
CONTROL "List1",IDC_LIST1,"SysListView32",LVS_LIST |
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT |
WS_BORDER | WS_TABSTOP,7,7,93,171
CONTROL "",IDC_CONTAINER,"Static",SS_ETCHEDFRAME,103,7,235,154
END
IDD_PREFERENCES_DISPLAY DIALOGEX 0, 0, 233, 154
STYLE WS_CHILD
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_TOOLBAR_BACKGROUND,84,6,93,14,ES_AUTOHSCROLL
CONTROL "Toolbar Background",IDC_CHECK_TOOLBAR_BACKGROUND,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,4,8,80,10
PUSHBUTTON "Browse...",IDC_BUTTON_BROWSE,179,6,50,14
END
IDD_PREFERENCES_PROXY DIALOGEX 0, 0, 233, 154
STYLE WS_CHILD
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_PROXY,51,4,178,14,ES_AUTOHSCROLL
LTEXT "Proxy Server:",IDC_STATIC,4,7,43,8
LTEXT "** Proxy Support Not Implemented Yet",IDC_STATIC,51,65,
120,8
END
IDD_PREFERENCES_GENERAL DIALOGEX 0, 0, 233, 154
STYLE WS_CHILD
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "Home Page:",IDC_STATIC,4,7,45,8
EDITTEXT IDC_EDIT_HOMEPAGE,49,4,180,14,ES_AUTOHSCROLL
LTEXT "When K-Meleon Starts, Display:",IDC_STATIC,4,24,101,8
CONTROL "Blank Page",IDC_RADIO_START_BLANK,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,113,23,53,10
CONTROL "Home Page",IDC_RADIO_START_HOME,"Button",
BS_AUTORADIOBUTTON,176,23,53,10
END
IDD_PREFERENCES_PLUGINS DIALOGEX 0, 0, 233, 154
STYLE WS_CHILD
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",IDC_LIST_PLUGINS,"SysListView32",LVS_LIST |
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT |
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,4,4,225,130
PUSHBUTTON "Configure",IDC_BUTTON_CONFIG,4,136,50,14
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
@ -286,9 +373,75 @@ BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 213
RIGHTMARGIN, 212
TOPMARGIN, 6
BOTTOMMARGIN, 72
BOTTOMMARGIN, 83
END
IDD_PROMPT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 257
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_PROMPT_USERNAME_PASSWORD, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
VERTGUIDE, 61
TOPMARGIN, 7
BOTTOMMARGIN, 95
HORZGUIDE, 44
HORZGUIDE, 62
END
IDD_PREFERENCES, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 338
TOPMARGIN, 7
BOTTOMMARGIN, 178
END
IDD_PREFERENCES_DISPLAY, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 229
VERTGUIDE, 84
TOPMARGIN, 4
BOTTOMMARGIN, 150
HORZGUIDE, 13
END
IDD_PREFERENCES_PROXY, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 229
VERTGUIDE, 51
TOPMARGIN, 4
BOTTOMMARGIN, 150
HORZGUIDE, 11
END
IDD_PREFERENCES_GENERAL, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 229
VERTGUIDE, 49
TOPMARGIN, 4
BOTTOMMARGIN, 150
HORZGUIDE, 11
HORZGUIDE, 28
END
IDD_PREFERENCES_PLUGINS, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 229
TOPMARGIN, 4
BOTTOMMARGIN, 150
END
END
#endif // APSTUDIO_INVOKED
@ -325,7 +478,7 @@ END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "K-Meleon"
AFX_IDS_IDLEMESSAGE "Ready"
AFX_IDS_IDLEMESSAGE "Document Done"
END
STRINGTABLE DISCARDABLE
@ -509,6 +662,11 @@ BEGIN
ID_VIEW_BACKGROUND "Show or hide the background image\nToggle Background"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_PREFERENCES "Edit Program Preferences.\nPreferences"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
@ -557,6 +715,9 @@ IDR_LINK_POPUP MENU DISCARDABLE
BEGIN
POPUP "Popup"
BEGIN
MENUITEM "Back", ID_GO_BACK
MENUITEM "Forward", ID_GO_FORWARD
MENUITEM SEPARATOR
MENUITEM "Open", ID_POPUP_OPEN
MENUITEM "Open in a New Window", ID_POPUP_OPENINANEWWINDOW
MENUITEM SEPARATOR

117
k-meleon/MainFrm.cpp

@ -52,8 +52,6 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_UPDATE_COMMAND_UI(ID_VIEW_LINKS_BAR, OnUpdateViewLinksBar)
ON_COMMAND(ID_VIEW_TEXTLABELS, OnViewTextlabels)
ON_UPDATE_COMMAND_UI(ID_VIEW_TEXTLABELS, OnUpdateViewTextlabels)
ON_COMMAND(ID_VIEW_BACKGROUND, OnViewBackground)
ON_UPDATE_COMMAND_UI(ID_VIEW_BACKGROUND, OnUpdateViewBackground)
ON_WM_SYSCOLORCHANGE()
ON_COMMAND(ID_HELP_WEB_KMELEON_HOME, OnHelpWebKmeleonHome)
ON_COMMAND(ID_HELP_WEB_KMELEON_FORUM, OnHelpWebKmeleonForum)
@ -62,6 +60,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND(ID_FILE_NEWWINDOW, OnFileNewwindow)
//}}AFX_MSG_MAP
ON_COMMAND(ID_VIEW_CUSTOMIZE, OnViewCustomize)
ON_COMMAND(ID_VIEW_PREFERENCES, OnViewPreferences)
ON_REGISTERED_MESSAGE(BCGM_RESETTOOLBAR, OnToolbarReset)
ON_REGISTERED_MESSAGE(BCGM_TOOLBARMENU, OnToolbarContextMenu)
ON_REGISTERED_MESSAGE(BCGM_CUSTOMIZEHELP, OnHelpCustomizeToolbars)
@ -69,6 +68,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND_RANGE(FIRST_FAVORITE_COMMAND, LAST_FAVORITE_COMMAND, OnFavorite)
ON_COMMAND_RANGE(FIRST_HISTORY_COMMAND, FIRST_HISTORY_COMMAND + HISTORY_LEN - 1, OnHistory)
ON_COMMAND(IDOK, OnNewAddressEnter)
ON_COMMAND_RANGE(2000, 2999, OnGenericCommand)
END_MESSAGE_MAP()
static UINT indicators[] =
@ -96,11 +96,23 @@ CMainFrame::~CMainFrame()
sMainFrameList.RemoveElement(this);
}
void CMainFrame::OnDestroy() {
// reassign the main window
if (theApp.m_pMainWnd->m_hWnd == m_hWnd){
theApp.m_pMainWnd = (CMainFrame *)sMainFrameList.ElementAt(1);
MessageBox("Done");
}
CFrameWnd::OnDestroy();
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!theApp.preferences)
theApp.preferences = new CPreferences(this);
CBCGToolBar::EnableQuickCustomization ();
LoadBackImage ();
@ -108,7 +120,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
//---------------------------------
// Set toolbar and menu image size:
//---------------------------------
// CBCGToolBar::SetSizes (CSize (36, 28), CSize (22, 20)); // big buttons
//CBCGToolBar::SetSizes (CSize (36, 28), CSize (22, 20)); // big buttons
CBCGToolBar::SetSizes (CSize (22, 20), CSize (16, 16)); // small buttons
CBCGToolBar::SetMenuSizes (CSize (22, 21), CSize (16, 15));
@ -211,7 +223,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
return -1; // fail to create
}
// m_wndMenuBar.AdjustLayout ();
m_wndMenuBar.AdjustLayout ();
m_wndToolBar.AdjustLayout ();
m_wndLinksBar.AdjustLayout ();
@ -272,8 +284,13 @@ BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if (m_menuParse.Load(CString("menus.txt"))){
cs.hMenu = m_menuParse.GetMenu()->m_hMenu;
}
else {
MessageBox("Ack! menus.txt is bad!");
}
return TRUE;
}
@ -375,7 +392,7 @@ int CMainFrame::BuildFavoritesMenu(LPCTSTR pszPath, int nStartPos, CMenu* pMenu)
if((wfd.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM))==0)
{
str = wfd.cFileName;
if(str.Right(4) == _T(".url"))
if(str.Right(4).CompareNoCase(_T(".url")))
{
// an .URL file is formatted just like an .INI file, so we can
// use GetPrivateProfileString() to get the information we want
@ -466,6 +483,11 @@ int CMainFrame::BuildFavoritesMenu(LPCTSTR pszPath, int nStartPos, CMenu* pMenu)
return nEndPos;
}
void CMainFrame::OnGenericCommand(UINT command) {
// see if any plugin wants it
theApp.plugins.OnCommand(command);
}
void CMainFrame::OnViewCustomize()
{
//------------------------------------
@ -478,6 +500,12 @@ void CMainFrame::OnViewCustomize()
pDlgCust->Create ();
}
void CMainFrame::OnViewPreferences(){
theApp.preferences->DoModal();
LoadBackImage();
SetBackImage();
}
LRESULT CMainFrame::OnToolbarContextMenu(WPARAM wp,LPARAM lp)
{
m_bMainToolbarMenu =
@ -526,7 +554,7 @@ LRESULT CMainFrame::OnHelpCustomizeToolbars(WPARAM wp, LPARAM lp)
BOOL CMainFrame::OnShowPopupMenu (CBCGPopupMenu* pMenuPopup)
{
CBCGFrameWnd::OnShowPopupMenu (pMenuPopup);
CFrameWnd::OnShowPopupMenu (pMenuPopup);
if (pMenuPopup == NULL)
{
@ -747,6 +775,9 @@ void CMainFrame::OnNewAddressEnter()
// list of addresses in the combo box.
CString str;
// stop current document first or bad stuff happens
((CMozilla *)GetActiveView())->SendMessage(WM_COMMAND, ID_VIEW_STOP);
m_wndAddress.GetEditCtrl()->GetWindowText(str);
((CMozilla *)GetActiveView())->Navigate(&str);
@ -758,6 +789,9 @@ void CMainFrame::OnNewAddressEnter()
m_wndAddress.InsertItem(&item);
m_wndAddress.GetEditCtrl()->SetSel(0,4096,TRUE);
// set focus to document so scrolling works as expected
((CMozilla *)GetActiveView())->SetFocus();
}
void CMainFrame::OnLink1()
@ -832,12 +866,19 @@ BOOL CMainFrame::GetToolbarButtonToolTipText (CBCGToolbarButton* pButton, CStrin
return FALSE; // Default tooltip text
}
//***************************************************************************************
void CMainFrame::OnViewBackground()
//*******************************************************************************************
void CMainFrame::OnSysColorChange()
{
theApp.m_bBackgroundImage = !theApp.m_bBackgroundImage;
CFrameWnd::OnSysColorChange();
//-------------------------
// Reload background image:
//-------------------------
LoadBackImage ();
SetBackImage ();
}
//***************************************************************************************
void CMainFrame::SetBackImage ()
{
@ -849,7 +890,7 @@ void CMainFrame::SetBackImage ()
memset (&info, 0, sizeof (REBARBANDINFO));
info.cbSize = sizeof (info);
info.fMask = RBBIM_BACKGROUND;
info.hbmBack = theApp.m_bBackgroundImage ? (HBITMAP)m_bmpBack : NULL;
info.hbmBack = theApp.preferences->bToolbarBackground ? (HBITMAP)m_bmpBack : NULL;
rc.SetBandInfo (i, &info);
CRect rectBand;
@ -868,22 +909,7 @@ void CMainFrame::SetBackImage ()
}
}
}
//*******************************************************************************************
void CMainFrame::OnUpdateViewBackground(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (theApp.m_bBackgroundImage);
}
//*******************************************************************************************
void CMainFrame::OnSysColorChange()
{
CFrameWnd::OnSysColorChange();
//-------------------------
// Reload background image:
//-------------------------
LoadBackImage ();
SetBackImage ();
}
//********************************************************************************************
void CMainFrame::LoadBackImage ()
{
@ -896,12 +922,20 @@ void CMainFrame::LoadBackImage ()
m_bmpBack.DeleteObject ();
}
HBITMAP hbmp = (HBITMAP) ::LoadImage (AfxGetResourceHandle (),
MAKEINTRESOURCE (IDB_BACK),
IMAGE_BITMAP,
0, 0,
LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
ASSERT (hbmp != NULL);
HBITMAP hbmp;
if (theApp.preferences->toolbarBackground.IsEmpty()){
hbmp = (HBITMAP) ::LoadImage (AfxGetResourceHandle (),
MAKEINTRESOURCE (IDB_BACK),
IMAGE_BITMAP,
0, 0,
LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
}else{
hbmp = (HBITMAP) ::LoadImage (AfxGetResourceHandle (),
theApp.preferences->toolbarBackground,
IMAGE_BITMAP,
0, 0,
LR_LOADMAP3DCOLORS | LR_LOADFROMFILE);
}
m_bmpBack.Attach (hbmp);
}
@ -929,8 +963,17 @@ void CMainFrame::onPageTitleChange(char *title)
void CMainFrame::onOverLink(char *link)
{
CMozilla *m=(CMozilla *)GetActiveView();
if(link && link[0]) m->SetLastLink(link);
SetMessageText(link);
// BHarris - oldStatus stuff
if(link && link[0]){
m_wndStatusBar.GetWindowText(oldStatus);
m->SetLastLink(link);
SetMessageText(link);
}else{
SetMessageText(oldStatus);
}
// BH end
}
void CMainFrame::onJSStatus(char *status)
@ -999,7 +1042,7 @@ void CMainFrame::OnHelpWebKmeleonForum()
void CMainFrame::OnGoStartPage()
{
((CMozilla *)GetActiveView())->Navigate(&theApp.m_sStartPage);
((CMozilla *)GetActiveView())->Navigate(&theApp.preferences->homePage);
}
void CMainFrame::OnGoSearchTheWeb()

32
k-meleon/MainFrm.h

@ -28,26 +28,35 @@
#include "MainToolBar.h"
#include "LinksBar.h"
#include "Preferences.h"
#include "MenuParser.h"
class CMainFrame : public CFrameWnd
{
public:
CMainFrame();
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
HIMAGELIST m_himSystem;
CSize m_SysImageSize;
HIMAGELIST m_himSystem;
CSize m_SysImageSize;
protected:
int m_iFolderIcon;
int m_iInternetShortcutIcon;
int m_iFolderIcon;
int m_iInternetShortcutIcon;
CBitmap m_bmpBack;
CBitmap m_bmpBack;
int m_iAnimationStarted;
// BHarris - save old status for onMouseOut
CString oldStatus;
CMenuParser m_menuParse;
int m_iAnimationStarted;
// Operations
public:
int setupBookmarks();
int BuildFavoritesMenu(LPCTSTR pszPath, int nStartPos, CMenu* pMenu);
@ -126,6 +135,7 @@ protected:
afx_msg void OnFileNewwindow();
//}}AFX_MSG
afx_msg void OnViewCustomize();
afx_msg void OnViewPreferences();
afx_msg LRESULT OnToolbarReset(WPARAM,LPARAM);
afx_msg LRESULT OnToolbarContextMenu(WPARAM,LPARAM);
afx_msg LRESULT OnHelpCustomizeToolbars(WPARAM wp, LPARAM lp);
@ -133,6 +143,10 @@ protected:
afx_msg void OnNewAddressEnter();
afx_msg void OnFavorite(UINT nID);
afx_msg void OnHistory(UINT nID);
afx_msg void OnDestroy();
afx_msg void OnGenericCommand(UINT nID);
DECLARE_MESSAGE_MAP()
};

3
k-meleon/MainToolBar.cpp

@ -52,7 +52,7 @@ END_MESSAGE_MAP()
BOOL CMainToolBar::RestoreOriginalstate ()
{
RemoveAllButtons ();
//RemoveAllButtons ();
CString str;
@ -99,5 +99,6 @@ BOOL CMainToolBar::RestoreOriginalstate ()
AdjustLayout ();
SetWindowText (_T("Standard"));
return TRUE;
}

26
k-meleon/Mozilla.cpp

@ -165,7 +165,11 @@ int CMozilla::Navigate(CString *url)
void CMozilla::OnGoBack()
{
if(mWebNav) mWebNav->GoBack();
if(mWebNav){
// BHarris - if you don't stop first, pages get overlaid
mWebNav->Stop();
mWebNav->GoBack();
}
}
void CMozilla::OnUpdateGoBack(CCmdUI* pCmdUI)
@ -180,7 +184,11 @@ void CMozilla::OnUpdateGoBack(CCmdUI* pCmdUI)
void CMozilla::OnGoForward()
{
if(mWebNav) mWebNav->GoForward();
if(mWebNav){
// BHarris - if you don't stop first, pages get overlaid
mWebNav->Stop();
mWebNav->GoForward();
}
}
void CMozilla::OnUpdateGoForward(CCmdUI* pCmdUI)
@ -368,8 +376,10 @@ BOOL CMozilla::PreTranslateMessage(MSG* pMsg)
void CMozilla::OnPopup(int flags)
{
int hmenu;
if(flags&nsIContextMenuListener::CONTEXT_LINK) hmenu=IDR_LINK_POPUP;
else hmenu=IDR_BROWSER_POPUP;
if (flags & nsIContextMenuListener::CONTEXT_LINK)
hmenu=IDR_LINK_POPUP;
else
hmenu=IDR_BROWSER_POPUP;
CMenu menu;
menu.LoadMenu(hmenu);
@ -377,10 +387,14 @@ void CMozilla::OnPopup(int flags)
CPoint point;
GetCursorPos(&point);
CMenu* pSumMenu = menu.GetSubMenu(0);
CMenu* pSubMenu = menu.GetSubMenu(0);
// BHarris
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x - 2, point.y - 2, this);
/*
CBCGPopupMenu* pPopupMenu = new CBCGPopupMenu;
pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE);
pPopupMenu->Create(this, point.x, point.y, (HMENU)pSubMenu->m_hMenu, FALSE, TRUE);
*/
}
void CMozilla::SetLastLink(char *link)

162
k-meleon/WebBrowserChrome.cpp

@ -29,6 +29,7 @@
#include "nsIDocShellTreeItem.h"
#include "nsIRequest.h"
#include "nsIChannel.h"
#include "nsIPrompt.h"
#include "nsCWebBrowser.h"
#include "nsWidgetsCID.h"
@ -70,7 +71,7 @@ NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) //optional
NS_INTERFACE_MAP_ENTRY(nsIPrompt)
NS_INTERFACE_MAP_ENTRY(nsIPrompt) // defined in prompt.cpp/h
NS_INTERFACE_MAP_END
//*****************************************************************************
@ -240,8 +241,9 @@ NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIRe
if (maxTotalProgress > 0)
{
PRUint32 percentage;
if(curTotalProgress>maxTotalProgress) percentage=100;
else percentage=(curTotalProgress * 100) / maxTotalProgress;
percentage=(curTotalProgress * 100) / maxTotalProgress;
if(curTotalProgress>maxTotalProgress)
percentage=100;
parentFrame->onProgressChange(percentage);
} else
parentFrame->onProgressChange(0);
@ -256,10 +258,14 @@ NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIReque
if (progressStateFlags & nsIWebProgressListener::STATE_IS_NETWORK) {
if (progressStateFlags & nsIWebProgressListener::STATE_START) {
if(parentFrame->IsWindowVisible())
if(parentFrame->IsWindowVisible()){
parentFrame->StartAnimation();
} else if (progressStateFlags & nsIWebProgressListener::STATE_STOP)
}
parentFrame->SetMessageText("Connecting..."); // BHarris
} else if (progressStateFlags & nsIWebProgressListener::STATE_STOP){
parentFrame->StopAnimation();
parentFrame->SetMessageText("Document Done"); // BHarris
}
}
return NS_OK;
}
@ -440,101 +446,93 @@ NS_IMETHODIMP WebBrowserChrome::OnShowContextMenu(PRUint32 aContextFlags, nsIDOM
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::Alert(const PRUnichar *dialogTitle, const PRUnichar *text)
{
nsString title(dialogTitle);
nsString txt(text);
char *strTitle=title.ToNewCString();
char *strTxt=txt.ToNewCString();
MessageBox(NULL,strTxt,strTitle,MB_ICONWARNING);
Recycle(strTxt);
Recycle(strTitle);
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::AlertCheck(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue)
{
MessageBox(NULL,"AlertCheck called","hu?",0);
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::Confirm(const PRUnichar *dialogTitle, const PRUnichar *text, PRBool *_retval)
{
nsString title(dialogTitle);
nsString txt(text);
char *strTitle=title.ToNewCString();
char *strTxt=txt.ToNewCString();
*_retval=(MessageBox(NULL,strTxt,strTitle,MB_OKCANCEL|MB_ICONQUESTION)==IDOK);
Recycle(strTxt);
Recycle(strTitle);
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::ConfirmCheck(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::Prompt(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::PromptUsernameAndPassword(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **user, PRUnichar **pwd, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::PromptPassword(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **pwd, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::Select(const PRUnichar *dialogTitle, const PRUnichar *text, PRUint32 count, const PRUnichar **selectList, PRInt32 *outSelection, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::UniversalDialog(const PRUnichar *titleMessage, const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkboxMsg, const PRUnichar *button0Text, const PRUnichar *button1Text, const PRUnichar *button2Text, const PRUnichar *button3Text, const PRUnichar *editfield1Msg, const PRUnichar *editfield2Msg, PRUnichar **editfield1Value, PRUnichar **editfield2Value, const PRUnichar *iconURL, PRBool *checkboxState, PRInt32 numberButtons, PRInt32 numberEditfields, PRInt32 editField1Password, PRInt32 *buttonPressed)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//*****************************************************************************
// WebBrowserChrome::nsIURIContentListener
//*****************************************************************************
NS_IMETHODIMP WebBrowserChrome::OnStartURIOpen(nsIURI *aURI, const char *aWindowTarget, PRBool *aAbortOpen)
{
MessageBox(NULL,"start uri open","tata",0);
return NS_ERROR_NOT_IMPLEMENTED;
}
if(mParentContentListener)
{
nsresult rv = mParentContentListener->OnStartURIOpen(aURI, aWindowTarget,
aAbortOpen);
if(NS_ERROR_NOT_IMPLEMENTED != rv)
return rv;
}
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::GetProtocolHandler(nsIURI *aURI, nsIProtocolHandler **aProtocolHandler)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_ENSURE_ARG_POINTER(aProtocolHandler);
NS_ENSURE_ARG(aURI);
if(mParentContentListener)
{
nsresult rv = mParentContentListener->GetProtocolHandler(aURI,
aProtocolHandler);
if(NS_ERROR_NOT_IMPLEMENTED != rv)
return rv;
}
*aProtocolHandler = nsnull;
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::DoContent(const char *aContentType, nsURILoadCommand aCommand,
const char *aWindowTarget, nsIChannel *aOpenedChannel,
nsIStreamListener **aContentHandler, PRBool *aAbortProcess)
{
return NS_ERROR_NOT_IMPLEMENTED;
MessageBox(NULL,"do content","tata",0);
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::IsPreferred(const char *aContentType, nsURILoadCommand aCommand,
const char *aWindowTarget, char **aDesiredContentType,
PRBool *aCanHandleContent)
{
*aCanHandleContent = PR_FALSE;
return NS_OK;
PRBool *aCanHandle)
{
NS_ENSURE_ARG_POINTER(aCanHandle);
NS_ENSURE_ARG_POINTER(aDesiredContentType);
if(mParentContentListener)
{
nsresult rv = mParentContentListener->IsPreferred(aContentType,
aCommand, aWindowTarget, aDesiredContentType, aCanHandle);
if(NS_ERROR_NOT_IMPLEMENTED != rv)
return rv;
}
*aCanHandle = PR_FALSE;
if(aContentType)
{
// (1) list all content types we want to be the primary handler for....
// and suggest a desired content type if appropriate...
if(nsCRT::strcasecmp(aContentType, "text/html") == 0
|| nsCRT::strcasecmp(aContentType, "text/xul") == 0
|| nsCRT::strcasecmp(aContentType, "text/rdf") == 0
|| nsCRT::strcasecmp(aContentType, "text/xml") == 0
|| nsCRT::strcasecmp(aContentType, "text/css") == 0
|| nsCRT::strcasecmp(aContentType, "image/gif") == 0
|| nsCRT::strcasecmp(aContentType, "image/jpeg") == 0
|| nsCRT::strcasecmp(aContentType, "image/png") == 0
|| nsCRT::strcasecmp(aContentType, "image/tiff") == 0
|| nsCRT::strcasecmp(aContentType, "application/http-index-format") == 0)
*aCanHandle = PR_TRUE;
}
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::CanHandleContent(const char *aContentType, nsURILoadCommand aCommand,
const char *aWindowTarget, char **aDesiredContentType,
PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
*_retval = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::GetLoadCookie(nsISupports * *aLoadCookie)
@ -549,12 +547,18 @@ NS_IMETHODIMP WebBrowserChrome::SetLoadCookie(nsISupports * aLoadCookie)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::GetParentContentListener(nsIURIContentListener * *aParentContentListener)
NS_IMETHODIMP WebBrowserChrome::GetParentContentListener(nsIURIContentListener * *aParentListener)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_ENSURE_ARG_POINTER(aParentListener);
*aParentListener = mParentContentListener;
NS_IF_ADDREF(*aParentListener);
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::SetParentContentListener(nsIURIContentListener * aParentContentListener)
NS_IMETHODIMP WebBrowserChrome::SetParentContentListener(nsIURIContentListener * aParentListener)
{
return NS_ERROR_NOT_IMPLEMENTED;
// Weak Reference, don't addref
mParentContentListener = aParentListener;
return NS_OK;
}

20
k-meleon/WebBrowserChrome.h

@ -31,7 +31,6 @@
#include "nsIWebNavigation.h"
#include "nsIWebProgressListener.h"
#include "nsIInterfaceRequestor.h"
#include "nsIPrompt.h"
#include "nsIWebBrowser.h"
#include "nsVoidArray.h"
#include "nsIContextMenuListener.h"
@ -39,13 +38,17 @@
#include "nsISHistory.h"
#include "nsIURIContentListener.h"
#include "Prompt.h"
//#include "UnknownFile.h"
class WebBrowserChrome : public nsIWebBrowserChrome,
public nsIWebProgressListener,
public nsIBaseWindow,
public nsIContextMenuListener,
public nsIPrompt,
public nsIContextMenuListener,
public nsIInterfaceRequestor,
public nsIURIContentListener
public nsIURIContentListener,
public CPrompt // BC -- implements all nsIPrompt stufs
// public CUnknownFile // BC -- Unknown file stuff
{
public:
WebBrowserChrome(nativeWindow nWindow, CMainFrame *parent);
@ -59,17 +62,18 @@ public:
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIBASEWINDOW
NS_DECL_NSICONTEXTMENULISTENER
NS_DECL_NSIPROMPT
NS_DECL_NSIINTERFACEREQUESTOR
protected:
nativeWindow mNativeWindow;
nsCOMPtr<nsIWebBrowser> mWebBrowser;
nsCOMPtr<nsIBaseWindow> mBaseWindow;
nsCOMPtr<nsIWebBrowserChrome> mTopWindow;
nsIURIContentListener* mParentContentListener; // Weak Reference
static nsVoidArray sBrowserList;
CMainFrame *parentFrame;

46
k-meleon/res/menus.txt

@ -0,0 +1,46 @@
#
# Menu Definition File for K-Meleon
#
# Not Complete, just an example
#
# Brian Harris <binaryc@teamreaction.com>
#
# Note: Popup must be defined *before* used as a submenu
Popup File
Open...\tCtrl+O=57601
New Window\tCtrl+N=32825
:Seperator
Close\tAlt+F4=57665
:EndPopup
Popup View
Toolbar=59392
StatusBar=59393
:Seperator
Preferences=32835
:EndPopup
Popup Go
Back\tAlt <-=32787
Forward\tAlt ->=32788
:Seperator
Start Page=32789
:EndPopup
Popup Help
K-Meleon Homepage=32826
K-Meleon Forums=32827
:Seperator
About K-Meleon...=57664
:EndPopup
MenuDef
:Popup File
:Popup View
:Popup Go
:Plugin Bookmarks=ns_bookmarks.dll
:Plugin Winamp=kmeleon_winamp.dll
:Popup Help
:EndMenu

31
k-meleon/resource.h

@ -30,6 +30,13 @@
#define IDC_PAN_DOWNRIGHT 149
#define IDR_BROWSER_POPUP 150
#define IDR_LINK_POPUP 151
#define IDD_PROMPT 152
#define IDD_PROMPT_USERNAME_PASSWORD 153
#define IDD_PREFERENCES 154
#define IDD_PREFERENCES_DISPLAY 155
#define IDD_PREFERENCES_PROXY 156
#define IDD_PREFERENCES_GENERAL 157
#define IDD_PREFERENCES_PLUGINS 158
#define IDB_COLDTOOLBAR 261
#define IDB_HOTTOOLBAR 262
#define IDS_WEB_TUTORIAL 736
@ -58,6 +65,22 @@
#define IDC_VERSION 1002
#define IDC_URL_GECKO 1002
#define IDC_URL_BCG 1003
#define IDC_EDITBOX 1003
#define IDC_CAPTION 1004
#define IDC_EDIT_USERNAME 1005
#define IDC_EDIT_PASSWORD 1006
#define IDC_LIST1 1009
#define IDC_CONTAINER 1010
#define IDC_EDIT1 1011
#define IDC_EDIT_TOOLBAR_BACKGROUND 1011
#define IDC_RADIO_START_HOME 1012
#define IDC_RADIO_START_BLANK 1013
#define IDC_EDIT_HOMEPAGE 1014
#define IDC_EDIT_PROXY 1015
#define IDC_CHECK_TOOLBAR_BACKGROUND 1016
#define IDC_BUTTON_BROWSE 1017
#define IDC_LIST_PLUGINS 1018
#define IDC_BUTTON_CONFIG 1019
#define IDS_FILETYPES 1201
#define ID_VIEW_ADDRESS_BAR 32722
#define ID_VIEW_CUSTOMIZE 32770
@ -98,15 +121,17 @@
#define ID_POPUP_OPENINANEWWINDOW 32831
#define ID_POPUP_COPYSHORTCUT 32832
#define ID_VIEW_SOURCE 32834
#define ID_PREFERENCES 32835
#define ID_VIEW_PREFERENCES 32836
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 152
#define _APS_NEXT_COMMAND_VALUE 32835
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_RESOURCE_VALUE 159
#define _APS_NEXT_COMMAND_VALUE 32837
#define _APS_NEXT_CONTROL_VALUE 1020
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif

Loading…
Cancel
Save