Browse Source

Move friend declarations into private class sections.

And hide them from Doxygen so it's not complaining. Related bug:
https://bugzilla.gnome.org/show_bug.cgi?id=776986
pull/225/head
Vladimír Vondruš 8 years ago
parent
commit
a4d32e650a
  1. 6
      src/Magnum/AbstractResourceLoader.h
  2. 14
      src/Magnum/Context.h
  3. 10
      src/Magnum/Platform/Screen.h
  4. 10
      src/Magnum/Platform/ScreenedApplication.h
  5. 6
      src/Magnum/Resource.h
  6. 10
      src/Magnum/SceneGraph/AbstractFeature.h
  7. 10
      src/Magnum/SceneGraph/AbstractObject.h
  8. 8
      src/Magnum/SceneGraph/Object.h

6
src/Magnum/AbstractResourceLoader.h

@ -101,8 +101,6 @@ Resource<Mesh> myMesh = manager->get<Mesh>("my-mesh");
buffers), should that be allowed? buffers), should that be allowed?
*/ */
template<class T> class AbstractResourceLoader { template<class T> class AbstractResourceLoader {
friend Implementation::ResourceManagerData<T>;
public: public:
explicit AbstractResourceLoader(): manager(nullptr), _requestedCount(0), _loadedCount(0), _notFoundCount(0) {} explicit AbstractResourceLoader(): manager(nullptr), _requestedCount(0), _loadedCount(0), _notFoundCount(0) {}
@ -213,6 +211,10 @@ template<class T> class AbstractResourceLoader {
virtual void doLoad(ResourceKey key) = 0; virtual void doLoad(ResourceKey key) = 0;
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ResourceManagerData<T>;
#endif
Implementation::ResourceManagerData<T>* manager; Implementation::ResourceManagerData<T>* manager;
std::size_t _requestedCount, std::size_t _requestedCount,
_loadedCount, _loadedCount,

14
src/Magnum/Context.h

@ -60,8 +60,6 @@ See also @ref Extensions namespace, which contain compile-time information
about OpenGL extensions. about OpenGL extensions.
*/ */
class MAGNUM_EXPORT Extension { class MAGNUM_EXPORT Extension {
friend Context;
public: public:
/** @brief All extensions for given OpenGL version */ /** @brief All extensions for given OpenGL version */
static const std::vector<Extension>& extensions(Version version); static const std::vector<Extension>& extensions(Version version);
@ -76,6 +74,10 @@ class MAGNUM_EXPORT Extension {
constexpr const char* string() const { return _string; } constexpr const char* string() const { return _string; }
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Context;
#endif
std::size_t _index; std::size_t _index;
Version _requiredVersion; Version _requiredVersion;
Version _coreVersion; Version _coreVersion;
@ -115,9 +117,6 @@ Arguments:
*/ */
class MAGNUM_EXPORT Context { class MAGNUM_EXPORT Context {
friend Implementation::ContextState;
friend Platform::Context;
public: public:
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
@ -572,6 +571,11 @@ class MAGNUM_EXPORT Context {
MAGNUM_LOCAL bool isCoreProfileInternal(Implementation::ContextState& state); MAGNUM_LOCAL bool isCoreProfileInternal(Implementation::ContextState& state);
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ContextState;
friend Platform::Context;
#endif
explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader()); explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader());
bool tryCreate(); bool tryCreate();

10
src/Magnum/Platform/Screen.h

@ -66,10 +66,6 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreen<XEglApplication>" - @ref XEglApplication "BasicScreen<XEglApplication>"
*/ */
template<class Application> class BasicScreen: private Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>> { template<class Application> class BasicScreen: private Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>> {
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend Containers::LinkedList<BasicScreen<Application>>;
friend BasicScreenedApplication<Application>;
public: public:
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
/** /**
@ -257,6 +253,12 @@ template<class Application> class BasicScreen: private Containers::LinkedListIte
virtual void mouseMoveEvent(MouseMoveEvent& event); virtual void mouseMoveEvent(MouseMoveEvent& event);
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend Containers::LinkedList<BasicScreen<Application>>;
friend BasicScreenedApplication<Application>;
#endif
PropagatedEvents _propagatedEvents; PropagatedEvents _propagatedEvents;
}; };

10
src/Magnum/Platform/ScreenedApplication.h

@ -97,10 +97,6 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreenedApplication<XEglApplication>" - @ref XEglApplication "BasicScreenedApplication<XEglApplication>"
*/ */
template<class Application> class BasicScreenedApplication: public Application, private Containers::LinkedList<BasicScreen<Application>> { template<class Application> class BasicScreenedApplication: public Application, private Containers::LinkedList<BasicScreen<Application>> {
friend Containers::LinkedList<BasicScreen<Application>>;
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend BasicScreen<Application>;
public: public:
/** /**
* @brief Default constructor * @brief Default constructor
@ -236,6 +232,12 @@ template<class Application> class BasicScreenedApplication: public Application,
virtual void globalDrawEvent() = 0; virtual void globalDrawEvent() = 0;
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<BasicScreen<Application>>;
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend BasicScreen<Application>;
#endif
/* The user is supposed to override only globalViewportEvent() and /* The user is supposed to override only globalViewportEvent() and
globalDrawEvent(), these implementations are dispatching the events globalDrawEvent(), these implementations are dispatching the events
to attached screens. */ to attached screens. */

6
src/Magnum/Resource.h

@ -119,8 +119,6 @@ template<class T, class U = T>
template<class T, class U> template<class T, class U>
#endif #endif
class Resource { class Resource {
friend Implementation::ResourceManagerData<T>;
public: public:
/** /**
* @brief Default constructor * @brief Default constructor
@ -215,6 +213,10 @@ class Resource {
} }
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ResourceManagerData<T>;
#endif
Resource(Implementation::ResourceManagerData<T>* manager, ResourceKey key): manager(manager), _key(key), lastCheck(0), _state(ResourceState::NotLoaded), data(nullptr) { Resource(Implementation::ResourceManagerData<T>* manager, ResourceKey key): manager(manager), _key(key), lastCheck(0), _state(ResourceState::NotLoaded), data(nullptr) {
manager->incrementReferenceCount(key); manager->incrementReferenceCount(key);
} }

10
src/Magnum/SceneGraph/AbstractFeature.h

@ -156,10 +156,6 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
: private Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>> : private Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>
#endif #endif
{ {
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
template<class> friend class Object;
public: public:
/** /**
* @brief Constructor * @brief Constructor
@ -278,6 +274,12 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
/*@}*/ /*@}*/
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
template<class> friend class Object;
#endif
CachedTransformations _cachedTransformations; CachedTransformations _cachedTransformations;
}; };

10
src/Magnum/SceneGraph/AbstractObject.h

@ -89,10 +89,6 @@ template<UnsignedInt dimensions, class T> class AbstractObject
: private Containers::LinkedList<AbstractFeature<dimensions, T>> : private Containers::LinkedList<AbstractFeature<dimensions, T>>
#endif #endif
{ {
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend AbstractFeature<dimensions, T>;
public: public:
/** @brief Matrix type */ /** @brief Matrix type */
typedef MatrixTypeFor<dimensions, T> MatrixType; typedef MatrixTypeFor<dimensions, T> MatrixType;
@ -272,6 +268,12 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/*@}*/ /*@}*/
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend AbstractFeature<dimensions, T>;
#endif
virtual AbstractObject<dimensions, T>* doScene() = 0; virtual AbstractObject<dimensions, T>* doScene() = 0;
virtual const AbstractObject<dimensions, T>* doScene() const = 0; virtual const AbstractObject<dimensions, T>* doScene() const = 0;

8
src/Magnum/SceneGraph/Object.h

@ -111,9 +111,6 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
, private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>> , private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>
#endif #endif
{ {
friend Containers::LinkedList<Object<Transformation>>;
friend Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
public: public:
/** @brief Matrix type */ /** @brief Matrix type */
typedef MatrixTypeFor<Transformation::Dimensions, typename Transformation::Type> MatrixType; typedef MatrixTypeFor<Transformation::Dimensions, typename Transformation::Type> MatrixType;
@ -360,6 +357,11 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
#endif #endif
private: private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<Object<Transformation>>;
friend Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
#endif
Object<Transformation>* doScene() override final; Object<Transformation>* doScene() override final;
const Object<Transformation>* doScene() const override final; const Object<Transformation>* doScene() const override final;

Loading…
Cancel
Save