зеркало из https://github.com/mozilla/pjs.git
Windows(98) integration feature
This commit is contained in:
Родитель
79b37f8596
Коммит
14612ae3d2
|
@ -0,0 +1,44 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __WPREFID_H_
|
||||
#define __WPREFID_H_
|
||||
|
||||
#ifndef MOZ_COMMUNICATOR_IIDS
|
||||
|
||||
// {464DC700-2727-11d2-8043-00600811A9C3}
|
||||
DEFINE_GUID(IID_IWindowsPrefs,
|
||||
0x464dc700, 0x2727, 0x11d2, 0x80, 0x43, 0x0, 0x60, 0x8, 0x11, 0xa9, 0xc3);
|
||||
|
||||
// {464DC701-2727-11d2-8043-00600811A9C3}
|
||||
DEFINE_GUID(CLSID_WindowsPrefs,
|
||||
0x464dc701, 0x2727, 0x11d2, 0x80, 0x43, 0x0, 0x60, 0x8, 0x11, 0xa9, 0xc3);
|
||||
|
||||
#else /* MOZ_COMMUNICATOR_IIDS */
|
||||
|
||||
// {464DC700-2727-11d2-8043-00600811A9C3}
|
||||
DEFINE_GUID(IID_IWindowsPrefs,
|
||||
0x464dc700, 0x2727, 0x11d2, 0x80, 0x43, 0x0, 0x60, 0x8, 0x11, 0xa9, 0xc3);
|
||||
|
||||
// {464DC701-2727-11d2-8043-00600811A9C3}
|
||||
DEFINE_GUID(CLSID_WindowsPrefs,
|
||||
0x464dc701, 0x2727, 0x11d2, 0x80, 0x43, 0x0, 0x60, 0x8, 0x11, 0xa9, 0xc3);
|
||||
|
||||
#endif /* MOZ_COMMUNICATOR_IIDS */
|
||||
|
||||
#endif /* __WPREFID_H_ */
|
|
@ -0,0 +1,62 @@
|
|||
IGNORE_MANIFEST=1
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
!ifndef MOZ_DEBUG
|
||||
OPTIMIZER=-O1 -UDEBUG -DNDEBUG
|
||||
!endif
|
||||
|
||||
DLLNAME = winpref
|
||||
PDBFILE = $(DLLNAME).pdb
|
||||
MAPFILE = $(DLLNAME).map
|
||||
DLL =.\$(OBJDIR)\$(DLLNAME).dll
|
||||
DEFFILE = winpref.def
|
||||
RESFILE = winpref.res
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
|
||||
LLIBS = $(DIST)\lib\prefuuid.lib \
|
||||
$(DIST)\lib\dllcom.lib \
|
||||
$(DIST)\lib\nsdlg$(MOZ_BITS).lib \
|
||||
$(DIST)\lib\xppref$(MOZ_BITS).lib
|
||||
LLIBS32 = ole32.lib comdlg32.lib shell32.lib uuid.lib
|
||||
|
||||
!if "$(_MSC_VER)" != "1100" && "$(_MSC_VER)" != "1200"
|
||||
LLIBS32 = $(LLIBS32) uuid2.lib
|
||||
!endif
|
||||
!if defined(MOZ_DEBUG) && defined(GLOWCODE)
|
||||
LLIBS32 = $(LLIBS32) $(GLOWDIR)\glowcode.lib
|
||||
!endif
|
||||
|
||||
LLIBS = $(LLIBS) $(LLIBS32)
|
||||
|
||||
MODULE=winprefs
|
||||
DEPTH=..\..\..\..\..
|
||||
REQUIRES=dllcom winprefs pref dbm nspr js libreg
|
||||
CPPSRCS=winpref.cpp winpages.cpp
|
||||
CPP_OBJS=.\$(OBJDIR)\winpref.obj .\$(OBJDIR)\winpages.obj
|
||||
LINCS=-I$(XPDIST)\public\dllcom -I$(XPDIST)\public\winprefs \
|
||||
-I$(XPDIST)\public\pref -I$(XPDIST)\public\dbm \
|
||||
-I$(XPDIST)\public\nspr -I$(XPDIST)\public\js \
|
||||
-I$(XPDIST)\public\libreg
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
||||
|
||||
libs:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
!if "$(WINOS)" != "WIN95"
|
||||
@$(DIST)\bin\dllreg $(DIST)\bin\$(DLLNAME).dll
|
||||
!endif
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
|
@ -0,0 +1,78 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __PAGES_H_
|
||||
#define __PAGES_H_
|
||||
|
||||
#include "cppageex.h"
|
||||
#include "xp_list.h"
|
||||
|
||||
//also in brpref\src\advpages.cpp, winfe\mnprefs.cpp
|
||||
#define WINPREF_PrefIsLocked(pPrefName) PREF_PrefIsLocked(pPrefName)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
|
||||
// CString interface to PREF_GetCharPref routine
|
||||
int
|
||||
PREF_GetStringPref(LPCSTR lpszPref, CString &str);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBasicWindowsPrefs
|
||||
|
||||
class CBasicWindowsPrefs : public CPropertyPageEx {
|
||||
public:
|
||||
CBasicWindowsPrefs();
|
||||
|
||||
protected:
|
||||
BOOL InitDialog();
|
||||
STDMETHODIMP Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal);
|
||||
BOOL DoTransfer(BOOL bSaveAndValidate);
|
||||
BOOL ApplyChanges();
|
||||
|
||||
// Event Processing
|
||||
LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL OnCommand(int id, HWND hwndCtl, UINT notifyCode);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAdvancedWindowsPrefs
|
||||
|
||||
class CAdvancedWindowsPrefs : public CPropertyPageEx {
|
||||
public:
|
||||
CAdvancedWindowsPrefs();
|
||||
|
||||
protected:
|
||||
BOOL InitDialog();
|
||||
STDMETHODIMP Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal);
|
||||
BOOL DoTransfer(BOOL bSaveAndValidate);
|
||||
BOOL ApplyChanges();
|
||||
|
||||
// Event Processing
|
||||
LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL OnCommand(int id, HWND hwndCtl, UINT notifyCode);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* __PAGES_H_ */
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by edpref.rc
|
||||
//
|
||||
#define IDD_BASICWINPREFS 100
|
||||
#define IDD_ADVANCEDWINPREFS 101
|
||||
|
||||
#define IDC_CHECK1 1001
|
||||
#define IDC_CHECK2 1002
|
||||
#define IDC_CHECK3 1003
|
||||
#define IDC_CHECK4 1004
|
||||
#define IDC_CHECK5 1005
|
||||
#define IDC_CHECK6 1006
|
||||
#define IDC_CHECK7 1007
|
||||
#define IDC_CHECK8 1008
|
||||
#define IDC_CHECK9 1009
|
||||
#define IDC_CHECK10 1010
|
||||
#define IDC_CHECK11 1011
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
#include <assert.h>
|
||||
#include "dllcom.h"
|
||||
#include "pages.h"
|
||||
#include "resource.h"
|
||||
#include "xp_core.h"
|
||||
#include "prefapi.h"
|
||||
#include "structs.h"
|
||||
#include "xp_help.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBasicWindowsPrefs implementation
|
||||
CBasicWindowsPrefs::CBasicWindowsPrefs()
|
||||
: CPropertyPageEx(CComDll::m_hInstance, IDD_BASICWINPREFS, HELP_PREFS_BASICWINPREFS)
|
||||
{
|
||||
// Set member data using XP preferences
|
||||
}
|
||||
|
||||
BOOL CBasicWindowsPrefs::InitDialog()
|
||||
{
|
||||
// Check for locked preferences
|
||||
|
||||
return CPropertyPageEx::InitDialog();
|
||||
}
|
||||
|
||||
STDMETHODIMP CBasicWindowsPrefs::Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal)
|
||||
{
|
||||
if (!m_bHasBeenActivated) {
|
||||
}
|
||||
|
||||
return CPropertyPageEx::Activate(hwndParent, lprc, bModal);
|
||||
}
|
||||
|
||||
BOOL CBasicWindowsPrefs::DoTransfer(BOOL bSaveAndValidate)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CBasicWindowsPrefs::ApplyChanges()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LRESULT CBasicWindowsPrefs::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return CPropertyPageEx::WindowProc(uMsg,wParam,lParam);
|
||||
}
|
||||
|
||||
BOOL CBasicWindowsPrefs::OnCommand(int id, HWND hwndCtl, UINT notifyCode)
|
||||
{
|
||||
return CPropertyPageEx::OnCommand(id, hwndCtl, notifyCode);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAdvancedWindowsPrefs implementation
|
||||
CAdvancedWindowsPrefs::CAdvancedWindowsPrefs()
|
||||
: CPropertyPageEx(CComDll::m_hInstance, IDD_ADVANCEDWINPREFS, HELP_PREFS_ADVANCEDWINPREFS)
|
||||
{
|
||||
// Set member data using XP preferences
|
||||
}
|
||||
|
||||
BOOL CAdvancedWindowsPrefs::InitDialog()
|
||||
{
|
||||
// Check for locked preferences
|
||||
|
||||
return CPropertyPageEx::InitDialog();
|
||||
}
|
||||
|
||||
STDMETHODIMP CAdvancedWindowsPrefs::Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal)
|
||||
{
|
||||
if (!m_bHasBeenActivated) {
|
||||
}
|
||||
|
||||
return CPropertyPageEx::Activate(hwndParent, lprc, bModal);
|
||||
}
|
||||
|
||||
BOOL CAdvancedWindowsPrefs::DoTransfer(BOOL bSaveAndValidate)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CAdvancedWindowsPrefs::ApplyChanges()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LRESULT CAdvancedWindowsPrefs::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return CPropertyPageEx::WindowProc(uMsg,wParam,lParam);
|
||||
}
|
||||
|
||||
BOOL CAdvancedWindowsPrefs::OnCommand(int id, HWND hwndCtl, UINT notifyCode)
|
||||
{
|
||||
return CPropertyPageEx::OnCommand(id, hwndCtl, notifyCode);
|
||||
}
|
|
@ -0,0 +1,386 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
#include "winpref.h"
|
||||
#include "pages.h"
|
||||
#include "wprefid.h"
|
||||
#include "prefuiid.h"
|
||||
#include "isppageo.h"
|
||||
#include <assert.h>
|
||||
|
||||
// Create a new instance of our derived class and return it.
|
||||
CComDll *
|
||||
DLL_ConsumerCreateInstance()
|
||||
{
|
||||
return new CWindowsPrefsDll;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSpecifyPropertyPageObjects
|
||||
|
||||
// Abstract class that supports aggregation as an inner object
|
||||
class CCategory : public IUnknown {
|
||||
public:
|
||||
CCategory();
|
||||
|
||||
// IUnknown methods. Doesn't delegate (explicit IUnknown)
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
public:
|
||||
// Abstract nested class that implements ISpecifyPropertyPageObjects
|
||||
class CSpecifyPageObjects : public ISpecifyPropertyPageObjects {
|
||||
public:
|
||||
CSpecifyPageObjects(CCategory *pBackObj, LPUNKNOWN pUnkOuter);
|
||||
|
||||
// IUnknown methods. Always delegates to controlling unknown
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
// ISpecifyPropertyPageObjects methods
|
||||
STDMETHODIMP GetPageObjects(CAPPAGE FAR* pPages) PURE;
|
||||
|
||||
private:
|
||||
CCategory *m_pBackObj;
|
||||
LPUNKNOWN m_pUnkOuter;
|
||||
};
|
||||
|
||||
private:
|
||||
ULONG m_uRef;
|
||||
};
|
||||
|
||||
CCategory::CCategory()
|
||||
{
|
||||
m_uRef = 0;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CCategory::AddRef()
|
||||
{
|
||||
return ++m_uRef;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CCategory::Release()
|
||||
{
|
||||
if (--m_uRef == 0) {
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("Destroying CCategory object.\n");
|
||||
#endif
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_uRef;
|
||||
}
|
||||
|
||||
CCategory::CSpecifyPageObjects::CSpecifyPageObjects(CCategory *pBackObj, LPUNKNOWN pUnkOuter)
|
||||
{
|
||||
assert(pBackObj);
|
||||
|
||||
// Don't add references to either the back pointer or the controlling unknown
|
||||
m_pBackObj = pBackObj;
|
||||
m_pUnkOuter = pUnkOuter;
|
||||
|
||||
// If we're not being aggregated then pUnkOuter will be NULL. In that case
|
||||
// delegate to the object in which we're contained
|
||||
if (!m_pUnkOuter)
|
||||
m_pUnkOuter = pBackObj;
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CCategory::CSpecifyPageObjects::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
// Delegate to the controlling unknown
|
||||
assert(m_pUnkOuter);
|
||||
return m_pUnkOuter->QueryInterface(riid, ppvObj);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CCategory::CSpecifyPageObjects::AddRef()
|
||||
{
|
||||
// Delegate to the controlling unknown
|
||||
assert(m_pUnkOuter);
|
||||
return m_pUnkOuter->AddRef();
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CCategory::CSpecifyPageObjects::Release()
|
||||
{
|
||||
// Delegate to the controlling unknown
|
||||
assert(m_pUnkOuter);
|
||||
return m_pUnkOuter->Release();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMailNewsCategory
|
||||
|
||||
class CWindowsCategory : public CCategory {
|
||||
public:
|
||||
CWindowsCategory(LPUNKNOWN pUnkOuter);
|
||||
|
||||
// IUnknown methods. Doesn't delegate (explicit IUnknown)
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
|
||||
|
||||
private:
|
||||
class CSpecifyWindowsPageObjects : public CCategory::CSpecifyPageObjects {
|
||||
public:
|
||||
CSpecifyWindowsPageObjects(CCategory *pBackObj, LPUNKNOWN pUnkOuter);
|
||||
|
||||
// ISpecifyPropertyPageObjects methods
|
||||
STDMETHODIMP GetPageObjects(CAPPAGE *pPages);
|
||||
};
|
||||
|
||||
CSpecifyWindowsPageObjects m_innerObj;
|
||||
};
|
||||
|
||||
CWindowsCategory::CWindowsCategory(LPUNKNOWN pUnkOuter)
|
||||
: m_innerObj(this, pUnkOuter)
|
||||
{
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CWindowsCategory::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
if (riid == IID_IUnknown) {
|
||||
*ppvObj = (LPVOID)this;
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
|
||||
} else if (riid == IID_ISpecifyPropertyPageObjects) {
|
||||
*ppvObj = (LPVOID)&m_innerObj;
|
||||
m_innerObj.AddRef();
|
||||
return NOERROR;
|
||||
|
||||
} else {
|
||||
*ppvObj = NULL;
|
||||
return ResultFromScode(E_NOINTERFACE);
|
||||
}
|
||||
}
|
||||
|
||||
CWindowsCategory::CSpecifyWindowsPageObjects::CSpecifyWindowsPageObjects(CCategory *pBackObj, LPUNKNOWN pUnkOuter)
|
||||
: CSpecifyPageObjects(pBackObj, pUnkOuter)
|
||||
{
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CWindowsCategory::CSpecifyWindowsPageObjects::GetPageObjects(CAPPAGE *pPages)
|
||||
{
|
||||
if (!pPages)
|
||||
return ResultFromScode(E_POINTER);
|
||||
|
||||
pPages->cElems = 2;
|
||||
pPages->pElems = (LPPROPERTYPAGE *)CoTaskMemAlloc(pPages->cElems * sizeof(LPPROPERTYPAGE));
|
||||
if (!pPages->pElems)
|
||||
return ResultFromScode(E_OUTOFMEMORY);
|
||||
|
||||
pPages->pElems[0] = new CBasicWindowsPrefs;
|
||||
pPages->pElems[1] = new CAdvancedWindowsPrefs;
|
||||
|
||||
for (ULONG i = 0; i < pPages->cElems; i++)
|
||||
pPages->pElems[i]->AddRef();
|
||||
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class CPropertyPageFactory
|
||||
|
||||
// Class factory for our property pages. We use the same C++ class
|
||||
// to handle all of our CLSIDs
|
||||
class CPropertyPageFactory : public IClassFactory {
|
||||
public:
|
||||
CPropertyPageFactory(REFCLSID rClsid);
|
||||
|
||||
// *** IUnknown methods ***
|
||||
STDMETHODIMP QueryInterface(REFIID, LPVOID FAR*);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
// *** IClassFactory methods ***
|
||||
STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR*);
|
||||
STDMETHODIMP LockServer(BOOL bLock);
|
||||
|
||||
private:
|
||||
CRefDll m_refDll;
|
||||
ULONG m_uRef;
|
||||
CLSID m_clsid;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPropertyPageFactory implementation
|
||||
|
||||
CPropertyPageFactory::CPropertyPageFactory(REFCLSID rClsid)
|
||||
{
|
||||
m_uRef = 0;
|
||||
m_clsid = rClsid;
|
||||
}
|
||||
|
||||
// *** IUnknown methods ***
|
||||
STDMETHODIMP CPropertyPageFactory::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
*ppvObj = NULL;
|
||||
|
||||
if (riid == IID_IUnknown || riid == IID_IClassFactory)
|
||||
*ppvObj = (LPVOID)this;
|
||||
|
||||
if (*ppvObj) {
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
return ResultFromScode(E_NOINTERFACE);
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP_(ULONG) CPropertyPageFactory::AddRef()
|
||||
{
|
||||
return ++m_uRef;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP_(ULONG) CPropertyPageFactory::Release(void)
|
||||
{
|
||||
if (--m_uRef == 0) {
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("Destroying CPropertyPageFactory class object.\n");
|
||||
#endif
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_uRef;
|
||||
}
|
||||
|
||||
// *** IClassFactory methods ***
|
||||
STDMETHODIMP CPropertyPageFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
// When requesting aggregation, the outer object must explicitly ask
|
||||
// for IUnknown
|
||||
if (pUnkOuter && riid != IID_IUnknown)
|
||||
return ResultFromScode(CLASS_E_NOAGGREGATION);
|
||||
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("CPropertyPageFactory::CreateInstance() called.\n");
|
||||
#endif
|
||||
LPUNKNOWN pCategory;
|
||||
|
||||
if (m_clsid == CLSID_WindowsPrefs)
|
||||
pCategory = new CWindowsCategory(pUnkOuter);
|
||||
|
||||
if (!pCategory)
|
||||
return ResultFromScode(E_OUTOFMEMORY);
|
||||
|
||||
pCategory->AddRef();
|
||||
HRESULT hRes = pCategory->QueryInterface(riid, ppvObj);
|
||||
pCategory->Release();
|
||||
return hRes;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CPropertyPageFactory::LockServer(BOOL bLock)
|
||||
{
|
||||
CComDll *pDll = CProcess::GetProcessDll();
|
||||
HRESULT hres;
|
||||
|
||||
assert(pDll);
|
||||
hres = CoLockObjectExternal(pDll, bLock, TRUE);
|
||||
pDll->Release();
|
||||
return hres;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CWindowsPrefsDll implementation
|
||||
|
||||
HRESULT
|
||||
CWindowsPrefsDll::GetClassObject(REFCLSID rClsid, REFIID riid, LPVOID *ppObj)
|
||||
{
|
||||
HRESULT hres = ResultFromScode(E_UNEXPECTED);
|
||||
*ppObj = NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("CWindowsPrefsDll::GetClassObject() called.\n");
|
||||
#endif
|
||||
|
||||
// See if we have that particular class object.
|
||||
if (rClsid == CLSID_WindowsPrefs) {
|
||||
|
||||
// Create a class object
|
||||
CPropertyPageFactory *pFactory = new CPropertyPageFactory(rClsid);
|
||||
|
||||
if (!pFactory)
|
||||
return ResultFromScode(E_OUTOFMEMORY);
|
||||
|
||||
// Get the desired interface. Note if the QueryInterface fails, the Release
|
||||
// will delete the class object
|
||||
pFactory->AddRef();
|
||||
hres = pFactory->QueryInterface(riid, ppObj);
|
||||
pFactory->Release();
|
||||
|
||||
} else {
|
||||
hres = ResultFromScode(CLASS_E_CLASSNOTAVAILABLE);
|
||||
}
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
// Return array of implemented CLSIDs by this DLL. Allocated
|
||||
// memory freed by caller.
|
||||
const CLSID **
|
||||
CWindowsPrefsDll::GetCLSIDs()
|
||||
{
|
||||
const CLSID **ppRetval = (const CLSID **)CoTaskMemAlloc(sizeof(CLSID *) * 2);
|
||||
|
||||
if (ppRetval) {
|
||||
ppRetval[0] = &CLSID_WindowsPrefs;
|
||||
ppRetval[2] = NULL;
|
||||
}
|
||||
|
||||
return ppRetval;
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
// The DLL is being loaded for the first time by a given process
|
||||
CComDll::m_hInstance = hInstance;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
// The DLL is being unloaded by a given process
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
// A thread is being created in a process that has already loaded
|
||||
// this DLL
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
// A thread is exiting cleanly in a process that has already
|
||||
// loaded this DLL
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
#include <dlgs.h>
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"#include <dlgs.h>\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_BASICWINPREFS DIALOG DISCARDABLE 0, 0, 256, 192
|
||||
STYLE WS_CHILD | WS_CLIPSIBLINGS
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "Files",IDC_STATIC,7,7,242,93
|
||||
LTEXT "Select the types of files you want Mozilla to handle. The currently selected types may not all be handled by Mozilla if another application has registered to handle them. Pressing ""OK"" will register Mozilla to handle all the selected types.",
|
||||
IDC_STATIC,14,15,232,32
|
||||
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
48,10,10
|
||||
LTEXT "HTML documents",IDC_STATIC,28,48,62,8
|
||||
LTEXT ".htm, .html",IDC_STATIC,133,48,50,10
|
||||
CONTROL "",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
58,10,10
|
||||
LTEXT "JPEG images",IDC_STATIC,28,58,47,8
|
||||
LTEXT ".jpg, .jpeg, .jpe, .jfif, .pjpeg, .pjp",IDC_STATIC,133,
|
||||
58,102,8
|
||||
CONTROL "",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
68,10,10
|
||||
LTEXT "GIF images",IDC_STATIC,28,68,40,8
|
||||
LTEXT ".gif",IDC_STATIC,133,68,14,8
|
||||
CONTROL "",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
78,10,10
|
||||
LTEXT "JavaScript programs",IDC_STATIC,28,78,69,8
|
||||
LTEXT ".js, .mocha",IDC_STATIC,133,78,50,8
|
||||
CONTROL "",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
88,10,10
|
||||
LTEXT "X bitmap images",IDC_STATIC,28,88,56,8
|
||||
LTEXT ".xbm",IDC_STATIC,133,88,20,8
|
||||
GROUPBOX "Intenet Shortcuts",IDC_STATIC,7,105,242,84
|
||||
LTEXT "Select the types of Internet Shortcuts you want Mozilla to handle. The currently selected types may not all be handled by Mozilla if another application has registered to handle them. Pressing ""Ok"" will register Mozilla to handle all the selected types.",
|
||||
IDC_STATIC,14,113,232,33
|
||||
CONTROL "",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
148,10,10
|
||||
LTEXT "HTML documents",IDC_STATIC,28,148,62,8
|
||||
LTEXT "http:",IDC_STATIC,133,148,19,8
|
||||
CONTROL "",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
158,10,10
|
||||
LTEXT "Secure HTML documents",IDC_STATIC,28,158,86,8
|
||||
LTEXT "https:",IDC_STATIC,133,158,22,8
|
||||
CONTROL "",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
168,10,10
|
||||
LTEXT "File transfers",IDC_STATIC,28,168,44,8
|
||||
LTEXT "ftp:",IDC_STATIC,133,168,15,8
|
||||
CONTROL "",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
178,10,10
|
||||
LTEXT "Old-fashioned Web relics",IDC_STATIC,28,178,84,8
|
||||
LTEXT "gopher:",IDC_STATIC,133,178,29,8
|
||||
END
|
||||
|
||||
IDD_ADVANCEDWINPREFS DIALOG DISCARDABLE 0, 0, 256, 192
|
||||
STYLE WS_CHILD | WS_CLIPSIBLINGS
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "Find On the Internet...",IDC_STATIC,7,7,242,30
|
||||
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
20,10,10
|
||||
LTEXT "Use Netscape's Netcenter search when you use the ""Find on the Internet..."" selection on your Start button.",
|
||||
IDC_STATIC,31,16,209,19
|
||||
GROUPBOX "Internet Keywords",IDC_STATIC,7,43,242,27
|
||||
CONTROL "",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,
|
||||
54,10,10
|
||||
LTEXT "Use ""Internet Keywords"" lookup on entries typed into the Address Toolbar.",
|
||||
IDC_STATIC,31,51,209,15
|
||||
GROUPBOX "Quick Launch Toolbar",IDC_STATIC,7,74,242,59
|
||||
LTEXT "Select the items you would like to have on your Quick Launch Toolbar.",
|
||||
IDC_STATIC,14,83,224,8
|
||||
CONTROL "Mozilla Browser",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
|
||||
BS_ICON | WS_TABSTOP,14,98,10,10
|
||||
ICON "",IDC_STATIC,27,92,21,20
|
||||
LTEXT "Navigator",IDC_STATIC,49,98,32,8
|
||||
CONTROL "Mozilla Browser",IDC_CHECK4,"Button",BS_AUTOCHECKBOX |
|
||||
BS_ICON | WS_TABSTOP,13,116,10,10
|
||||
ICON "",IDC_STATIC,27,111,21,20
|
||||
LTEXT "Composer",IDC_STATIC,49,116,32,8
|
||||
CONTROL "Mozilla Browser",IDC_CHECK5,"Button",BS_AUTOCHECKBOX |
|
||||
BS_ICON | WS_TABSTOP,135,98,10,10
|
||||
ICON "",IDC_STATIC,148,93,21,20
|
||||
LTEXT "My Netscape",IDC_STATIC,170,98,43,8
|
||||
GROUPBOX "Links Toolbar",IDC_STATIC,7,137,242,52
|
||||
CONTROL "Mozilla Browser",IDC_CHECK6,"Button",BS_AUTOCHECKBOX |
|
||||
BS_ICON | WS_TABSTOP,135,116,10,10
|
||||
ICON "",IDC_STATIC,148,110,21,20
|
||||
LTEXT "Netcenter",IDC_STATIC,170,116,32,8
|
||||
LTEXT "Select the items you would to have on your Links Toolbar.",
|
||||
IDC_STATIC,13,147,183,8
|
||||
CONTROL "Netcenter",IDC_CHECK7,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,14,159,47,10
|
||||
CONTROL "My Netscape",IDC_CHECK8,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,14,169,58,10
|
||||
CONTROL "Netcenter Search",IDC_CHECK9,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,93,159,72,10
|
||||
CONTROL "Warpzilla",IDC_CHECK10,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,93,169,45,10
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDD_BASICWINPREFS "Desktop Integration\nTake back the Internet"
|
||||
IDD_ADVANCEDWINPREFS "Advanced\nDeath to Internet Explorer"
|
||||
END
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
Загрузка…
Ссылка в новой задаче