From f619802272e638fdb9ac49d0ac00ee36222af8da Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Wed, 18 Nov 1998 22:29:44 +0000 Subject: [PATCH] Initial checkin of files. --- editor/txmgr/Makefile | 24 +++++++ editor/txmgr/Makefile.in | 33 ++++++++++ editor/txmgr/makefile.win | 23 +++++++ editor/txmgr/public/Makefile | 29 ++++++++ editor/txmgr/public/Makefile.in | 38 +++++++++++ editor/txmgr/public/makefile.win | 29 ++++++++ editor/txmgr/public/nsITransaction.h | 66 +++++++++++++++++++ editor/txmgr/public/nsITransactionManager.h | 73 +++++++++++++++++++++ editor/txmgr/src/Makefile | 38 +++++++++++ editor/txmgr/src/Makefile.in | 43 ++++++++++++ editor/txmgr/src/makefile.win | 73 +++++++++++++++++++++ editor/txmgr/src/transactionManager.cpp | 17 +++++ editor/txmgr/src/transactionManager.h | 32 +++++++++ 13 files changed, 518 insertions(+) create mode 100644 editor/txmgr/Makefile create mode 100644 editor/txmgr/Makefile.in create mode 100644 editor/txmgr/makefile.win create mode 100644 editor/txmgr/public/Makefile create mode 100644 editor/txmgr/public/Makefile.in create mode 100644 editor/txmgr/public/makefile.win create mode 100644 editor/txmgr/public/nsITransaction.h create mode 100644 editor/txmgr/public/nsITransactionManager.h create mode 100644 editor/txmgr/src/Makefile create mode 100644 editor/txmgr/src/Makefile.in create mode 100644 editor/txmgr/src/makefile.win create mode 100644 editor/txmgr/src/transactionManager.cpp create mode 100644 editor/txmgr/src/transactionManager.h diff --git a/editor/txmgr/Makefile b/editor/txmgr/Makefile new file mode 100644 index 000000000000..afe6eeaaaddf --- /dev/null +++ b/editor/txmgr/Makefile @@ -0,0 +1,24 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH = .. + +DIRS = public src + +include $(DEPTH)/config/config.mk + +include $(DEPTH)/config/rules.mk diff --git a/editor/txmgr/Makefile.in b/editor/txmgr/Makefile.in new file mode 100644 index 000000000000..6903f7b15537 --- /dev/null +++ b/editor/txmgr/Makefile.in @@ -0,0 +1,33 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH = .. +topsrcdir = @top_srcdir@ +VPATH = @srcdir@ +srcdir = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +DIRS = public src + +ifdef ENABLE_TESTS +DIRS += tests +endif + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk diff --git a/editor/txmgr/makefile.win b/editor/txmgr/makefile.win new file mode 100644 index 000000000000..f1e7ad71a774 --- /dev/null +++ b/editor/txmgr/makefile.win @@ -0,0 +1,23 @@ +#!nmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=.. +IGNORE_MANIFEST=1 + +DIRS=public src + +include <$(DEPTH)\config\rules.mak> diff --git a/editor/txmgr/public/Makefile b/editor/txmgr/public/Makefile new file mode 100644 index 000000000000..5f1189d9ebe9 --- /dev/null +++ b/editor/txmgr/public/Makefile @@ -0,0 +1,29 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=../.. + +EXPORTS = \ + nsITransaction.h \ + nsITransactionManager.h \ + $(NULL) + +MODULE = txmgr + +include $(DEPTH)/config/config.mk + +include $(DEPTH)/config/rules.mk diff --git a/editor/txmgr/public/Makefile.in b/editor/txmgr/public/Makefile.in new file mode 100644 index 000000000000..da09e668ccb4 --- /dev/null +++ b/editor/txmgr/public/Makefile.in @@ -0,0 +1,38 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +DEFINES = + +EXPORTS = \ + nsITransaction.h \ + nsITransactionManager.h \ + $(NULL) + +EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) + +MODULE = txmgr + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk diff --git a/editor/txmgr/public/makefile.win b/editor/txmgr/public/makefile.win new file mode 100644 index 000000000000..34e5c762efab --- /dev/null +++ b/editor/txmgr/public/makefile.win @@ -0,0 +1,29 @@ +#!nmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=..\.. +IGNORE_MANIFEST=1 + +EXPORTS = \ + nsITransaction.h \ + nsITransactionManager.h \ + $(NULL) + +MODULE = txmgr + +include <$(DEPTH)\config\rules.mak> + diff --git a/editor/txmgr/public/nsITransaction.h b/editor/txmgr/public/nsITransaction.h new file mode 100644 index 000000000000..1b6959a22f7a --- /dev/null +++ b/editor/txmgr/public/nsITransaction.h @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.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 nsITransaction_h__ +#define nsITransaction_h__ +#include "nsISupports.h" +#include "nsIOutputStream.h" +/* +Transaction interface to outside world +*/ + +#define NS_TRANSACTION_IID \ +{ /* 58E330C1-7B48-11d2-98B9-00805F297D89 */ \ +0x58e330c1, 0x7b48, 0x11d2, \ +{ 0x98, 0xb9, 0x0, 0x80, 0x5f, 0x29, 0x7d, 0x89 } } + + +/** + * A transaction specific interface. + *

+ * It's implemented by an object that executes some behavior that must be tracked + * by the transaction manager. + */ +class nsITransaction : public nsISupports{ +public: + + /** + * Execute() tells the implementation of nsITransaction to execute itself. + */ + virtual nsresult Execute(void) = 0; + + /** + * Undo() tells the implementation of nsITransaction to undo it's execution. + */ + virtual nsresult Undo(void) = 0; + + /** + * Redo() tells the implementation of nsITransaction to redo it's execution. + */ + virtual nsresult Redo(void) = 0; + + /** + * Write() tells the implementation of nsITransaction to write a representation + * of itself. + * @param nsIOutputStream * + */ + virtual nsresult Write(nsIOutputStream *) = 0; +}; + +#endif // nsITransaction + diff --git a/editor/txmgr/public/nsITransactionManager.h b/editor/txmgr/public/nsITransactionManager.h new file mode 100644 index 000000000000..dd8cf490b999 --- /dev/null +++ b/editor/txmgr/public/nsITransactionManager.h @@ -0,0 +1,73 @@ +/* -*- 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.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 nsITransactionManager_h__ +#define nsITransactionManager_h__ +#include "nsISupports.h" +#include "nsITransaction.h" +#include "nsIOutputStream.h" + +/* +Transaction Manager interface to outside world +*/ + +#define NS_TRANSACTION_MANAGER_IID \ +{ /* 58E330C2-7B48-11d2-98B9-00805F297D89 */ \ +0x58e330c2, 0x7b48, 0x11d2, \ +{ 0x98, 0xb9, 0x0, 0x80, 0x5f, 0x29, 0x7d, 0x89 } }; + + +/** + * A transaction manager specific interface. + *

+ * It's implemented by an object that tracks transactions. + */ +class nsITransactionManager : public nsISupports{ +public: + + /** + * Execute() tells the implementation of nsITransactionManager to execute a transaction. + * @param nsITransaction *tx the transaction to execute. + */ + virtual nsresult Execute(nsITransaction *tx) = 0; + + /** + * Undo() tells the implementation of nsITransactionManager to undo the specified number + * of transactions. + * @param PRInt32 n number of transactions to undo. n <= 0 means undo all transactions. + */ + virtual nsresult Undo(PRInt32 n) = 0; + + /** + * Redo() tells the implementation of nsITransactionManager to redo the specified number + * of transactions. + * @param PRInt32 n number of transactions to redo. n <= 0 means redo all transactions + * previously undone. + */ + virtual nsresult Redo(PRInt32 n) = 0; + + /** + * Write() tells the implementation of nsITransactionManager to write a representation + * of itself. + * @param nsIOutputStream * + */ + virtual nsresult Write(nsIOutputStream *) = 0; +}; + +#endif // nsITransactionManager + diff --git a/editor/txmgr/src/Makefile b/editor/txmgr/src/Makefile new file mode 100644 index 000000000000..652009a2e033 --- /dev/null +++ b/editor/txmgr/src/Makefile @@ -0,0 +1,38 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=../.. + + +LIBRARY_NAME = txmgr + +CPPSRCS = \ + transactionManager.cpp \ + $(NULL) + +MODULE = txmgr + +REQUIRES = xpcom + +include $(DEPTH)/config/config.mk + +TARGET = $(LIBARY) + +include $(DEPTH)/config/rules.mk + +test: + @echo OS_ARCH = $(OS_ARCH) diff --git a/editor/txmgr/src/Makefile.in b/editor/txmgr/src/Makefile.in new file mode 100644 index 000000000000..a76be817956d --- /dev/null +++ b/editor/txmgr/src/Makefile.in @@ -0,0 +1,43 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=../.. + +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +LIBRARY_NAME = txmgr + +CPPSRCS = \ + transactionManager.cpp \ + $(NULL) + +MODULE = txmgr + +REQUIRES = xpcom + +include $(topsrcdir)/config/config.mk + +TARGET = $(LIBARY) + +include $(topsrcdir)/config/rules.mk + +test: + @echo OS_ARCH = $(OS_ARCH) diff --git a/editor/txmgr/src/makefile.win b/editor/txmgr/src/makefile.win new file mode 100644 index 000000000000..bffabd04c485 --- /dev/null +++ b/editor/txmgr/src/makefile.win @@ -0,0 +1,73 @@ +#!nmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. + +DEPTH=..\.. +IGNORE_MANIFEST=1 + +LIBRARY_NAME=ender + +CPPSRCS = \ + editor.cpp \ + editorInterfaces.cpp \ + $(NULL) + +CPP_OBJS = \ + .\$(OBJDIR)\editor.obj \ + .\$(OBJDIR)\editorInterfaces.obj \ + $(NULL) + +MODULE=editor + +REQUIRES=xpcom raptor dom base + +LINCS=-I$(PUBLIC)\editor \ + -I$(PUBLIC)\xpcom \ + -I$(PUBLIC)\raptor \ + -I$(PUBLIC)\js \ + -I$(PUBLIC)\dom + +MAKE_OBJ_TYPE = DLL +DLLNAME = ender +DLL=.\$(OBJDIR)\$(DLLNAME).dll + +LCFLAGS = \ + $(LCFLAGS) \ + $(DEFINES) \ + $(NULL) + +DEFINES = $(DEFINES) -DNOT_PRODUCTION_CODE -DUSE_EXPERIMENTAL_SMART_POINTERS + +# These are the libraries we need to link with to create the dll +LLIBS= \ + $(DIST)\lib\xpcom32.lib \ + $(DIST)\lib\libplc21.lib \ + $(DIST)\lib\raptorbase.lib \ + $(LIBNSPR) +!if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE) +LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib +!endif + + +include <$(DEPTH)\config\rules.mak> + +libs:: $(DLL) + $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin + $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib + +clobber:: + rm -f $(DIST)\bin\$(DLLNAME).dll + rm -f $(DIST)\lib\$(DLLNAME).lib diff --git a/editor/txmgr/src/transactionManager.cpp b/editor/txmgr/src/transactionManager.cpp new file mode 100644 index 000000000000..25437b136368 --- /dev/null +++ b/editor/txmgr/src/transactionManager.cpp @@ -0,0 +1,17 @@ +/* -*- 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.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. + */ diff --git a/editor/txmgr/src/transactionManager.h b/editor/txmgr/src/transactionManager.h new file mode 100644 index 000000000000..c103a98fc844 --- /dev/null +++ b/editor/txmgr/src/transactionManager.h @@ -0,0 +1,32 @@ +/* -*- 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.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://wwwt.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 transactionManager_h__ +#define transactionManager_h__ + +#include "nsITransactionManager.h" +#include "COM_auto_ptr.h" + +/** implementation of a transaction manager object. + * + */ +class TransactionManager : public nsITransactionManager +{ +}; + +#endif // transactionManager_h__