gecko-dev/dom/tools/JSStubGen.h

99 строки
3.4 KiB
C
Исходник Обычный вид История

1998-06-04 03:32:26 +04:00
/* -*- 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/
1998-06-04 03:32:26 +04:00
*
* 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.
1998-06-04 03:32:26 +04:00
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
1998-06-04 03:32:26 +04:00
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
1998-06-04 03:32:26 +04:00
*/
#ifndef _JSStubGen_h__
#define _JSStubGen_h__
#include <string.h>
#include "plhash.h"
#include "FileGen.h"
#ifdef XP_MAC
#include <ostream.h> // required for namespace resolution
#else
1998-06-04 03:32:26 +04:00
class ofstream;
#endif
1998-06-04 03:32:26 +04:00
class IdlSpecification;
class IdlInterface;
class IdlAttribute;
class JSStubGen : public FileGen {
public:
JSStubGen();
1999-09-01 04:54:53 +04:00
virtual ~JSStubGen();
1998-06-04 03:32:26 +04:00
virtual void Generate(char *aFileName, char *aOutputDirName,
IdlSpecification &aSpec, int aIsGlobal);
1998-06-04 03:32:26 +04:00
friend PRIntn JSStubGen_IIDEnumerator(PLHashEntry *he,
PRIntn i,
void *arg);
friend PRIntn JSStubGen_DefPtrEnumerator(PLHashEntry *he,
PRIntn i,
void *arg);
protected:
enum {
JSSTUBGEN_PRIMARY,
JSSTUBGEN_NONPRIMARY,
JSSTUBGEN_DEFAULT,
JSSTUBGEN_DEFAULT_NONPRIMARY,
JSSTUBGEN_DEFAULT_ELLIPSIS,
JSSTUBGEN_DEFAULT_NONPRIMARY_ELLIPSIS,
JSSTUBGEN_NAMED_ITEM,
JSSTUBGEN_NAMED_ITEM_NONPRIMARY,
JSSTUBGEN_NAMED_ITEM_ELLIPSIS,
JSSTUBGEN_NAMED_ITEM_NONPRIMARY_ELLIPSIS
};
1998-06-04 03:32:26 +04:00
void GenerateIncludes(IdlSpecification &aSpec);
void GenerateIIDDefinitions(IdlSpecification &aSpec);
void GenerateDefPtrs(IdlSpecification &aSpec);
void GeneratePropertySlots(IdlSpecification &aSpec);
void GeneratePropertyFunc(IdlSpecification &aSpec, PRBool aIsGetter);
void GenerateCustomPropertyFuncs(IdlSpecification &aSpec);
1998-06-04 03:32:26 +04:00
void GenerateFinalize(IdlSpecification &aSpec);
void GenerateEnumerate(IdlSpecification &aSpec);
void GenerateResolve(IdlSpecification &aSpec);
void GenerateMethods(IdlSpecification &aSpec);
void GenerateJSClass(IdlSpecification &aSpec);
void GenerateClassProperties(IdlSpecification &aSpec);
void GenerateClassFunctions(IdlSpecification &aSpec);
void GenerateConstructor(IdlSpecification &aSpec);
void GenerateInitClass(IdlSpecification &aSpec);
void GenerateNew(IdlSpecification &aSpec);
void GeneratePropGetter(ofstream *file,
IdlInterface &aInterface,
IdlVariable &aAttribute,
PRInt32 aType);
1998-06-04 03:32:26 +04:00
void GeneratePropSetter(ofstream *file,
IdlInterface &aInterface,
IdlAttribute &aAttribute,
PRBool aIsPrimary);
int mIsGlobal;
1998-06-04 03:32:26 +04:00
};
#endif // _JSStubGen_h__