changes to get autopointers to work

This commit is contained in:
mjudge%netscape.com 1998-11-11 20:44:02 +00:00
Родитель d3b71028ee
Коммит baca672151
10 изменённых файлов: 52 добавлений и 46 удалений

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

@ -25,9 +25,9 @@ CPPSRCS = \
$(NULL)
MODULE = raptor
MODULE = editor
REQUIRES = xpcom raptor
REQUIRES = xpcom raptor dom js
include $(DEPTH)/config/config.mk

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

@ -26,14 +26,14 @@
Editor::Editor()
{
//initialize member variables here
};
}
Editor::~Editor()
{
//the autopointers will clear themselves up.
};
}
@ -49,13 +49,13 @@ Editor::Init(nsIDOMDocument *aDomInterface)
mDomInterfaceP = aDomInterface;
nsresult t_result = NS_NewEditorKeyListener(context_AddRefs<nsEditorKeyListener>(mKeyListenerP), this);
nsresult t_result = NS_NewEditorKeyListener(context_AddRefs(mKeyListenerP), this);
if (NS_OK != t_result)
{
assert(FALSE);
return t_result;
}
t_result = NS_NewEditorMouseListener(context_AddRefs<nsEditorMouseListener>(mMouseListenerP), this);
t_result = NS_NewEditorMouseListener(context_AddRefs(mMouseListenerP), this);
if (NS_OK != t_result)
{
mKeyListener = 0; //dont keep the key listener if the mouse listener fails.
@ -63,7 +63,7 @@ Editor::Init(nsIDOMDocument *aDomInterface)
return t_result;
}
COM_auto_ptr<nsIDOMEventReceiver> erP;
t_result = mDomInterfaceP->QueryInterface(kIDOMEventReceiverIID, context_AddRefs<nsIDOMEventReceiver>(erP));
t_result = mDomInterfaceP->QueryInterface(kIDOMEventReceiverIID, context_AddRefs(erP));
if (NS_OK != t_result)
{
mKeyListener = 0;
@ -71,8 +71,8 @@ Editor::Init(nsIDOMDocument *aDomInterface)
assert(FALSE);
return t_result;
}
er->AddEventListener(mKeyListenerP, kIDOMKeyListenerIID);
er->AddEventListener(mMouseListenerP, kIDOMMouseListenerIID);
erP->AddEventListener(mKeyListenerP, kIDOMKeyListenerIID);
erP->AddEventListener(mMouseListenerP, kIDOMMouseListenerIID);
}
@ -81,14 +81,14 @@ Editor::Init(nsIDOMDocument *aDomInterface)
//BEGIN Editor Calls from public
PR_Bool
PRBool
Editor::KeyDown(int aKeycode)
{
}
PR_Bool
PRBool
Editor::MouseClick(int aX,int aY)
{
}

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

@ -18,7 +18,7 @@
#include "nsIEditor.h"
#include "COM_auto_ptr.h"
#include "editorInterfaces.h"
/** implementation of an editor object. it will be the controler/focal point
* for the main editor services. i.e. the GUIControler, publishing, transaction
@ -29,8 +29,8 @@ class Editor : public nsIEditor
{
private:
COM_auto_ptr<nsIDOMDocument> mDomInterfaceP;
COM_auto_ptr<nsEditorKeyListener> mKeyListenerP;
COM_auto_ptr<nsEditorMouseListener> mMouseListenerP;
COM_auto_ptr<nsIDOMEventListener> mKeyListenerP;
COM_auto_ptr<nsIDOMEventListener> mMouseListenerP;
public:
/** The default constructor. This should suffice. the setting of the interfaces is done
* after the construction of the editor class.
@ -45,10 +45,10 @@ public:
/*see the nsIEditor for more details*/
virtual nsresult Init(nsIDOMDocument *aDomInterface);
virtual nsresult GetDomInterface(nsIDOMDocument **aDomInterface){*aDomInterface = mDomInterfaceP;}
virtual nsresult GetDomInterface(nsIDOMDocument **aDomInterface){*aDomInterface = mDomInterfaceP; return NS_OK;}
virtual nsresult SetProperties(PROPERTIES aProperty){}
virtual nsresult GetProperties(PROPERTIES &){}
virtual nsresult SetProperties(PROPERTIES aProperty){return NS_OK;}
virtual nsresult GetProperties(PROPERTIES &){return NS_OK;}
/*END nsIEditor interfaces*/
/*BEGIN Editor interfaces*/
@ -60,14 +60,14 @@ public:
* value of the key that was hit for now
* @return False if ignored
*/
PR_Bool KeyDown(int aKeycode);
PRBool KeyDown(int aKeycode);
/*MouseListener Methods*/
/** MouseClick
* @param int x the xposition of the click
* @param int y the yposition of the click
*/
PR_Bool MouseClick(int aX,int aY); //it should also tell us the dom element that was selected.
PRBool MouseClick(int aX,int aY); //it should also tell us the dom element that was selected.
};

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

@ -28,13 +28,15 @@ CPP_OBJS = \
.\$(OBJDIR)\editor.obj \
$(NULL)
MODULE=raptor
MODULE=editor
REQUIRES=xpcom raptor dom
LINCS=-I$(PUBLIC)\xpcom \
LINCS=-I$(PUBLIC)\editor \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\dom
-I$(PUBLIC)\js \
-I$(PUBLIC)\dom
MAKE_OBJ_TYPE = DLL
DLLNAME = ender

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

@ -25,9 +25,9 @@ CPPSRCS = \
$(NULL)
MODULE = raptor
MODULE = editor
REQUIRES = xpcom raptor
REQUIRES = xpcom raptor dom js
include $(DEPTH)/config/config.mk

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

@ -26,14 +26,14 @@
Editor::Editor()
{
//initialize member variables here
};
}
Editor::~Editor()
{
//the autopointers will clear themselves up.
};
}
@ -49,13 +49,13 @@ Editor::Init(nsIDOMDocument *aDomInterface)
mDomInterfaceP = aDomInterface;
nsresult t_result = NS_NewEditorKeyListener(context_AddRefs<nsEditorKeyListener>(mKeyListenerP), this);
nsresult t_result = NS_NewEditorKeyListener(context_AddRefs(mKeyListenerP), this);
if (NS_OK != t_result)
{
assert(FALSE);
return t_result;
}
t_result = NS_NewEditorMouseListener(context_AddRefs<nsEditorMouseListener>(mMouseListenerP), this);
t_result = NS_NewEditorMouseListener(context_AddRefs(mMouseListenerP), this);
if (NS_OK != t_result)
{
mKeyListener = 0; //dont keep the key listener if the mouse listener fails.
@ -63,7 +63,7 @@ Editor::Init(nsIDOMDocument *aDomInterface)
return t_result;
}
COM_auto_ptr<nsIDOMEventReceiver> erP;
t_result = mDomInterfaceP->QueryInterface(kIDOMEventReceiverIID, context_AddRefs<nsIDOMEventReceiver>(erP));
t_result = mDomInterfaceP->QueryInterface(kIDOMEventReceiverIID, context_AddRefs(erP));
if (NS_OK != t_result)
{
mKeyListener = 0;
@ -71,8 +71,8 @@ Editor::Init(nsIDOMDocument *aDomInterface)
assert(FALSE);
return t_result;
}
er->AddEventListener(mKeyListenerP, kIDOMKeyListenerIID);
er->AddEventListener(mMouseListenerP, kIDOMMouseListenerIID);
erP->AddEventListener(mKeyListenerP, kIDOMKeyListenerIID);
erP->AddEventListener(mMouseListenerP, kIDOMMouseListenerIID);
}
@ -81,14 +81,14 @@ Editor::Init(nsIDOMDocument *aDomInterface)
//BEGIN Editor Calls from public
PR_Bool
PRBool
Editor::KeyDown(int aKeycode)
{
}
PR_Bool
PRBool
Editor::MouseClick(int aX,int aY)
{
}

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

@ -18,7 +18,7 @@
#include "nsIEditor.h"
#include "COM_auto_ptr.h"
#include "editorInterfaces.h"
/** implementation of an editor object. it will be the controler/focal point
* for the main editor services. i.e. the GUIControler, publishing, transaction
@ -29,8 +29,8 @@ class Editor : public nsIEditor
{
private:
COM_auto_ptr<nsIDOMDocument> mDomInterfaceP;
COM_auto_ptr<nsEditorKeyListener> mKeyListenerP;
COM_auto_ptr<nsEditorMouseListener> mMouseListenerP;
COM_auto_ptr<nsIDOMEventListener> mKeyListenerP;
COM_auto_ptr<nsIDOMEventListener> mMouseListenerP;
public:
/** The default constructor. This should suffice. the setting of the interfaces is done
* after the construction of the editor class.
@ -45,10 +45,10 @@ public:
/*see the nsIEditor for more details*/
virtual nsresult Init(nsIDOMDocument *aDomInterface);
virtual nsresult GetDomInterface(nsIDOMDocument **aDomInterface){*aDomInterface = mDomInterfaceP;}
virtual nsresult GetDomInterface(nsIDOMDocument **aDomInterface){*aDomInterface = mDomInterfaceP; return NS_OK;}
virtual nsresult SetProperties(PROPERTIES aProperty){}
virtual nsresult GetProperties(PROPERTIES &){}
virtual nsresult SetProperties(PROPERTIES aProperty){return NS_OK;}
virtual nsresult GetProperties(PROPERTIES &){return NS_OK;}
/*END nsIEditor interfaces*/
/*BEGIN Editor interfaces*/
@ -60,14 +60,14 @@ public:
* value of the key that was hit for now
* @return False if ignored
*/
PR_Bool KeyDown(int aKeycode);
PRBool KeyDown(int aKeycode);
/*MouseListener Methods*/
/** MouseClick
* @param int x the xposition of the click
* @param int y the yposition of the click
*/
PR_Bool MouseClick(int aX,int aY); //it should also tell us the dom element that was selected.
PRBool MouseClick(int aX,int aY); //it should also tell us the dom element that was selected.
};

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

@ -28,13 +28,15 @@ CPP_OBJS = \
.\$(OBJDIR)\editor.obj \
$(NULL)
MODULE=raptor
MODULE=editor
REQUIRES=xpcom raptor dom
LINCS=-I$(PUBLIC)\xpcom \
LINCS=-I$(PUBLIC)\editor \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\dom
-I$(PUBLIC)\js \
-I$(PUBLIC)\dom
MAKE_OBJ_TYPE = DLL
DLLNAME = ender

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

@ -20,9 +20,10 @@ DEPTH=../..
EXPORTS = \
nsIEditor.h \
nsEditorInterfaces.h \
$(NULL)
MODULE = raptor
MODULE = editor
include $(DEPTH)/config/config.mk

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

@ -20,9 +20,10 @@ IGNORE_MANIFEST=1
EXPORTS = \
nsIEditor.h \
nsEditorInterfaces.h \
$(NULL)
MODULE = raptor
MODULE = editor
include <$(DEPTH)\config\rules.mak>