1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/public/TypeDecls.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,73 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99: 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +// This file contains public type declarations that are used *frequently*. If 1.11 +// it doesn't occur at least 10 times in Gecko, it probably shouldn't be in 1.12 +// here. 1.13 +// 1.14 +// It includes only: 1.15 +// - forward declarations of structs and classes; 1.16 +// - typedefs; 1.17 +// - enums (maybe). 1.18 +// It does *not* contain any struct or class definitions. 1.19 + 1.20 +#ifndef js_TypeDecls_h 1.21 +#define js_TypeDecls_h 1.22 + 1.23 +#include <stddef.h> 1.24 +#include <stdint.h> 1.25 + 1.26 +#include "js-config.h" 1.27 + 1.28 +struct JSContext; 1.29 +class JSFunction; 1.30 +class JSObject; 1.31 +class JSScript; 1.32 +class JSString; 1.33 + 1.34 +struct jsid; 1.35 + 1.36 +typedef char16_t jschar; 1.37 + 1.38 +namespace JS { 1.39 + 1.40 +class Value; 1.41 +template <typename T> class Handle; 1.42 +template <typename T> class MutableHandle; 1.43 +template <typename T> class Rooted; 1.44 +template <typename T> class PersistentRooted; 1.45 + 1.46 +typedef Handle<JSFunction*> HandleFunction; 1.47 +typedef Handle<jsid> HandleId; 1.48 +typedef Handle<JSObject*> HandleObject; 1.49 +typedef Handle<JSScript*> HandleScript; 1.50 +typedef Handle<JSString*> HandleString; 1.51 +typedef Handle<Value> HandleValue; 1.52 + 1.53 +typedef MutableHandle<JSFunction*> MutableHandleFunction; 1.54 +typedef MutableHandle<jsid> MutableHandleId; 1.55 +typedef MutableHandle<JSObject*> MutableHandleObject; 1.56 +typedef MutableHandle<JSScript*> MutableHandleScript; 1.57 +typedef MutableHandle<JSString*> MutableHandleString; 1.58 +typedef MutableHandle<Value> MutableHandleValue; 1.59 + 1.60 +typedef Rooted<JSObject*> RootedObject; 1.61 +typedef Rooted<JSFunction*> RootedFunction; 1.62 +typedef Rooted<JSScript*> RootedScript; 1.63 +typedef Rooted<JSString*> RootedString; 1.64 +typedef Rooted<jsid> RootedId; 1.65 +typedef Rooted<JS::Value> RootedValue; 1.66 + 1.67 +typedef PersistentRooted<JSFunction*> PersistentRootedFunction; 1.68 +typedef PersistentRooted<jsid> PersistentRootedId; 1.69 +typedef PersistentRooted<JSObject*> PersistentRootedObject; 1.70 +typedef PersistentRooted<JSScript*> PersistentRootedScript; 1.71 +typedef PersistentRooted<JSString*> PersistentRootedString; 1.72 +typedef PersistentRooted<Value> PersistentRootedValue; 1.73 + 1.74 +} // namespace JS 1.75 + 1.76 +#endif /* js_TypeDecls_h */