ViXEn VFD Shell stubs. not part of build.

This commit is contained in:
ben%netscape.com 2000-09-05 01:58:17 +00:00
Родитель 3d131d79b7
Коммит 214de474a8
12 изменённых файлов: 467 добавлений и 42 удалений

Просмотреть файл

Просмотреть файл

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

Просмотреть файл

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
interface nsIDOMElement;
[scriptable, uuid(86b91da8-2516-4478-8dad-4c17185f1065)]
interface nsIVixenShell : nsISupports
{
void setAttribute(in nsIDOMElement aElement, in wstring aAttribute, in wstring aValue);
void removeAttribute(in nsIDOMElement aElement, in wstring aAttribute);
void insertElement(in nsIDOMElement aElement, in nsIDOMElement aParent, in PRInt32 aPos);
void removeElement(in nsIDOMElement aElement);
};
%{ C++
#define NS_VIXENSHELL_CID \
{ /* 5029a73a-8ff6-4d30-99df-f53cd44f2542 */ \
0x5029a73a, 0x8ff6, 0x4d30, \
{0x99, 0xdf, 0xf5, 0x3c, 0xd4, 0x4f, 0x25, 0x42} }
#define NS_VIXENSHELL_PROGID \
"component://netscape/vixen/shell"
%}

Просмотреть файл

@ -0,0 +1,57 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..\..
LIBRARY_NAME=vixen_s
MODULE=vixen
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
CPPSRCS= \
nsVixenShell.cpp \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\nsVixenShell.obj \
$(NULL)
EXPORTS = \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
-I$(PUBLIC)\dom -I$(PUBLIC)\uconv
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

Просмотреть файл

@ -0,0 +1,160 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsVixenShell.h"
#include "nsTransactionManagerCID.h"
#include "nsITransactionManager.h"
// Supported Transactions
/*
#include "VxSetAttributeTxn.h"
#include "VxRemoveAttributeTxn.h"
#include "VxInsertElementTxn.h"
#include "VxRemoveElementTxn.h"
*/
// Transaction Manager DLL
#ifdef XP_PC
#define TRANSACTION_MANAGER_DLL "txmgr.dll"
#else
#ifdef XP_MAC
#define TRANSACTION_MANAGER_DLL "TRANSACTION_MANAGER_DLL"
#else // XP_UNIX || XP_BEOS
#define TRANSACTION_MANAGER_DLL "libtxmgr"MOZ_DLL_SUFFIX
#endif
#endif
nsVixenShell::nsVixenShell()
{
NS_INIT_REFCNT();
}
nsVixenShell::~nsVixenShell()
{
}
NS_IMPL_ISUPPORTS1(nsVixenShell, nsIVixenShell);
NS_IMETHODIMP
nsVixenShell::SetAttribute(nsIDOMElement *aElement,
const PRUnichar *aAttribute,
const PRUnichar *aValue)
{
/*
VxChangeAttributeTxn *txn;
nsresult rv = CreateTxnForSetAttribute(aElement, aAttribute, aValue, &txn);
if (NS_SUCCEEDED(rv))
rv = Do(txn);
NS_IF_RELEASE(txn);
return rv;
*/
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::RemoveAttribute(nsIDOMElement *aElement,
const PRUnichar *aAttribute)
{
/*
VxRemoveAttributeTxn *txn;
nsresult rv = CreateTxnForRemoveAttribute(aElement, aAttribute, &txn);
if (NS_SUCCEEDED(rv))
rv = Do(txn);
NS_IF_RELEASE(txn);
return rv;
*/
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::InsertElement(nsIDOMElement *aElement,
nsIDOMElement *aParent,
PRInt32 aPos)
{
/*
VxInsertElementTxn *txn;
nsresult rv = CreateTxnForInsertElement(aElement, aParent, aPos, &txn);
if (NS_SUCCEEDED(rv))
rv = Do(txn);
NS_IF_RELEASE(txn);
return rv;
*/
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::RemoveElement(nsIDOMElement *aElement)
{
/*
VxRemoveElementTxn *txn;
nsresult rv = CreateTxnForRemoveElement(aElement, &txn);
if (NS_SUCCEEDED(rv))
rv = Do(txn);
NS_IF_RELEASE(txn);
return rv;
*/
return NS_OK;
}
// Execute Transactions
NS_IMETHODIMP
nsVixenShell::Do(nsITransaction* aTxn)
{
return NS_OK;
}
// Create Transformations for the Transaction Manager
NS_IMETHODIMP
nsVixenShell::CreateTxnForSetAttribute(nsIDOMElement* aElement,
const nsString& aAttribute,
const nsString& aValue,
VxChangeAttributeTxn** aTxn)
{
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::CreateTxnForRemoveAttribute(nsIDOMElement* aElement,
const nsString& aAttribute,
VxRemoveAttributeTxn** aTxn)
{
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::CreateTxnForInsertElement(nsIDOMElement* aElement,
nsIDOMElement* aParent,
PRInt32 aPos,
VxInsertElementTxn** aTxn)
{
return NS_OK;
}
NS_IMETHODIMP
nsVixenShell::CreateTxnForRemoveElement(nsIDOMElement* aElement,
VxRemoveElementTxn** aTxn)
{
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,77 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef __vixenShell_h__
#define __vixenShell_h__
#endif
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsIVixenShell.h"
#define NS_VIXENSHELL_CID \
{ 0x5029a73a, 0x8ff6, 0x4d30, {0x99, 0xdf, 0xf5, 0x3c, 0xd4, 0x4f, 0x25, 0x42} }
#define NS_VIXENSHELL_PROGID "component://netscape/vixen/shell"
class VxChangeAttributeTxn;
class VxRemoveAttributeTxn;
class VxInsertElementTxn;
class VxRemoveElementTxn;
class nsITransaction;
class nsIDOMElement;
class nsVixenShell : public nsIVixenShell
{
public:
nsVixenShell();
~nsVixenShell();
NS_DECL_ISUPPORTS
NS_DECL_NSIVIXENSHELL
public:
// Execute Transactions
NS_IMETHOD Do(nsITransaction* aTxn);
// Create transactions for the Transaction Manager
NS_IMETHOD CreateTxnForSetAttribute(nsIDOMElement* aElement,
const nsString& aAttribute,
const nsString& aValue,
VxChangeAttributeTxn** aTxn);
NS_IMETHOD CreateTxnForRemoveAttribute(nsIDOMElement* aElement,
const nsString& aAttribute,
VxRemoveAttributeTxn** aTxn);
NS_IMETHOD CreateTxnForInsertElement(nsIDOMElement* aElement,
nsIDOMElement* aParent,
PRInt32 aPos,
VxInsertElementTxn** aTxn);
NS_IMETHOD CreateTxnForRemoveElement(nsIDOMElement* aElement,
VxRemoveElementTxn** aTxn);
};

Просмотреть файл

Просмотреть файл

@ -0,0 +1,46 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..\..
MODULE=vixen
LIBNAME = .\$(OBJDIR)\vixen
DLL = $(LIBNAME).dll
################################################################################
## library
LINCS=-I..\..\base\src
CPP_OBJS= \
.\$(OBJDIR)\nsVixenModule.obj \
$(NULL)
LLIBS= \
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\vixen_s.lib \
$(LIBNSPR) \
$(NULL)
include <$(DEPTH)/config/rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin\components
$(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib

Просмотреть файл

@ -0,0 +1,36 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsIGenericFactory.h"
#include "nsVixenShell.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsVixenShell)
static nsModuleComponentInfo components[] =
{
{ "Vixen Shell", NS_VIXENSHELL_CID, NS_VIXENSHELL_PROGID, nsVixenShellConstructor,
NULL, NULL
}
};
NS_IMPL_NSGETMODULE("nsVixenModule", components)

Просмотреть файл

Просмотреть файл

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

Просмотреть файл

@ -31,13 +31,29 @@ function _dd(aString)
dump("*** " + aString + "\n");
}
function _ddf(aString, aValue)
{
if (_DEBUG)
dump("*** " + aString + " = " + aValue + "\n");
}
const kMenuHeight = 130;
const kPropertiesWidth = 170;
var gVixenShell;
function vx_Startup()
{
_dd("vx_Startup");
// initialise the vfd shell (this is not a service! need to shift to new_vfd)
const kVixenProgid = "component://netscape/vixen/shell";
gVixenShell = nsJSComponentManager.createInstance(kVixenProgid, "nsIVixenShell");
gVixenShell.foopy = "Noopy";
_ddf("Foopy", gVixenShell.foopy);
// size the window
window.moveTo(0,0);
window.outerWidth = screen.availWidth;
window.outerHeight = kMenuHeight;
@ -48,31 +64,17 @@ function vx_Startup()
// load a scratch document
vx_LoadForm("chrome://vixen/content/vfdScratch.xul");
var url = Components.classes["component://netscape/network/standard-url"].createInstance();
if (url) url = url.QueryInterface(Components.interfaces.nsIURI);
url.spec = "chrome://vixen/skin/vfdScratch.css";
var chromeRegistry = Components.classes["component://netscape/chrome/chrome-registry"].getService();
chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
var url2 = chromeRegistry.convertChromeURL(url);
dump(url2);
}
function vx_Shutdown()
{
_dd("vx_Shutdown");
const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
var windows = wm.getXULWindowEnumerator("xuledit:document");
while (windows.hasMoreElements()) {
var currWindow = windows.getNext();
currWindow.close();
}
}
function vx_LoadForm(aURL)
{
hwnd = openDialog(aURL, "", "chrome,dialog=no,resizable");
hwnd = openDialog(aURL, "", "chrome,dialog=no,resizable,dependant");
hwnd.moveTo(kPropertiesWidth + 5, kMenuHeight + 5);
hwnd.outerWidth = screen.availWidth - (kPropertiesWidth * 2) - 5;
hwnd.outerHeight = screen.availHeight - kMenuHeight - 20;