directbase: Introduce BUILDING_ defines for each component

Ditto everything before, but for direct.
This commit is contained in:
Sam Edwards 2018-03-20 00:09:09 -06:00
parent bd2a9d709a
commit f231ba4cd7
28 changed files with 100 additions and 56 deletions

View File

@ -80,12 +80,6 @@ using namespace std;
#define nassertv(condition) assert(condition) #define nassertv(condition) assert(condition)
#define nassertv_always(condition) assert(condition) #define nassertv_always(condition) assert(condition)
// Panda defines these export symbols for building DLL's. Outside of Panda,
// we assume we're not putting this code in a DLL, so we define them to
// nothing.
#define EXPCL_DIRECT
#define EXPTP_DIRECT
// Panda defines a special Filename class. We'll use an ordinary string // Panda defines a special Filename class. We'll use an ordinary string
// instead. // instead.
typedef string Filename; typedef string Filename;

View File

@ -18,10 +18,10 @@
#include "notifyCategoryProxy.h" #include "notifyCategoryProxy.h"
#include "configVariableBool.h" #include "configVariableBool.h"
NotifyCategoryDecl(deadrec, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(deadrec, EXPCL_DIRECT_DEADREC, EXPTP_DIRECT_DEADREC);
extern ConfigVariableBool accept_clock_skew; extern ConfigVariableBool accept_clock_skew;
extern EXPCL_DIRECT void init_libdeadrec(); extern EXPCL_DIRECT_DEADREC void init_libdeadrec();
#endif #endif

View File

@ -38,7 +38,7 @@ static const int max_timestamp_delays = 10;
* update. The assumption is that all SmoothMovers in the world will be * update. The assumption is that all SmoothMovers in the world will be
* operating in the same mode together. * operating in the same mode together.
*/ */
class EXPCL_DIRECT SmoothMover { class EXPCL_DIRECT_DEADREC SmoothMover {
PUBLISHED: PUBLISHED:
SmoothMover(); SmoothMover();
~SmoothMover(); ~SmoothMover();

View File

@ -16,12 +16,62 @@
/* See dtoolsymbols.h for a rant on the purpose of this file. */ /* See dtoolsymbols.h for a rant on the purpose of this file. */
/* BUILDING_DIRECT is just a buildsystem shortcut for all of these: */
#ifdef BUILDING_DIRECT #ifdef BUILDING_DIRECT
#define EXPCL_DIRECT EXPORT_CLASS #define BUILDING_DIRECT_DEADREC
#define EXPTP_DIRECT EXPORT_TEMPL #define BUILDING_DIRECT_DIRECTD
#define BUILDING_DIRECT_INTERVAL
#define BUILDING_DIRECT_MOTIONTRAIL
#define BUILDING_DIRECT_SHOWBASE
#define BUILDING_DIRECT_DISTRIBUTED
#endif
#ifdef BUILDING_DIRECT_DEADREC
#define EXPCL_DIRECT_DEADREC EXPORT_CLASS
#define EXPTP_DIRECT_DEADREC EXPORT_TEMPL
#else #else
#define EXPCL_DIRECT IMPORT_CLASS #define EXPCL_DIRECT_DEADREC IMPORT_CLASS
#define EXPTP_DIRECT IMPORT_TEMPL #define EXPTP_DIRECT_DEADREC IMPORT_TEMPL
#endif
#ifdef BUILDING_DIRECT_DIRECTD
#define EXPCL_DIRECT_DIRECTD EXPORT_CLASS
#define EXPTP_DIRECT_DIRECTD EXPORT_TEMPL
#else
#define EXPCL_DIRECT_DIRECTD IMPORT_CLASS
#define EXPTP_DIRECT_DIRECTD IMPORT_TEMPL
#endif
#ifdef BUILDING_DIRECT_INTERVAL
#define EXPCL_DIRECT_INTERVAL EXPORT_CLASS
#define EXPTP_DIRECT_INTERVAL EXPORT_TEMPL
#else
#define EXPCL_DIRECT_INTERVAL IMPORT_CLASS
#define EXPTP_DIRECT_INTERVAL IMPORT_TEMPL
#endif
#ifdef BUILDING_DIRECT_MOTIONTRAIL
#define EXPCL_DIRECT_MOTIONTRAIL EXPORT_CLASS
#define EXPTP_DIRECT_MOTIONTRAIL EXPORT_TEMPL
#else
#define EXPCL_DIRECT_MOTIONTRAIL IMPORT_CLASS
#define EXPTP_DIRECT_MOTIONTRAIL IMPORT_TEMPL
#endif
#ifdef BUILDING_DIRECT_SHOWBASE
#define EXPCL_DIRECT_SHOWBASE EXPORT_CLASS
#define EXPTP_DIRECT_SHOWBASE EXPORT_TEMPL
#else
#define EXPCL_DIRECT_SHOWBASE IMPORT_CLASS
#define EXPTP_DIRECT_SHOWBASE IMPORT_TEMPL
#endif
#ifdef BUILDING_DIRECT_DISTRIBUTED
#define EXPCL_DIRECT_DISTRIBUTED EXPORT_CLASS
#define EXPTP_DIRECT_DISTRIBUTED EXPORT_TEMPL
#else
#define EXPCL_DIRECT_DISTRIBUTED IMPORT_CLASS
#define EXPTP_DIRECT_DISTRIBUTED IMPORT_TEMPL
#endif #endif
#endif #endif

View File

@ -52,7 +52,7 @@ typedef int HANDLE;
* presented in order chronologically by their intended usage. The first * presented in order chronologically by their intended usage. The first
* group will probably provide everthing needed for DirectD. * group will probably provide everthing needed for DirectD.
*/ */
class EXPCL_DIRECT DirectD { class EXPCL_DIRECT_DIRECTD DirectD {
PUBLISHED: PUBLISHED:
DirectD(); DirectD();
~DirectD(); ~DirectD();

View File

@ -53,7 +53,7 @@ class SocketStream;
* the C++ layer, while server messages that are not understood by the C++ * the C++ layer, while server messages that are not understood by the C++
* layer are returned up to the Python layer for processing. * layer are returned up to the Python layer for processing.
*/ */
class EXPCL_DIRECT CConnectionRepository { class EXPCL_DIRECT_DISTRIBUTED CConnectionRepository {
PUBLISHED: PUBLISHED:
explicit CConnectionRepository(bool has_owner_view = false, explicit CConnectionRepository(bool has_owner_view = false,
bool threaded_net = false); bool threaded_net = false);

View File

@ -28,7 +28,7 @@ class CConnectionRepository;
* This class defines some basic methods of DistributedSmoothNodeBase which * This class defines some basic methods of DistributedSmoothNodeBase which
* have been moved into C++ as a performance optimization. * have been moved into C++ as a performance optimization.
*/ */
class EXPCL_DIRECT CDistributedSmoothNodeBase { class EXPCL_DIRECT_DISTRIBUTED CDistributedSmoothNodeBase {
PUBLISHED: PUBLISHED:
CDistributedSmoothNodeBase(); CDistributedSmoothNodeBase();
~CDistributedSmoothNodeBase(); ~CDistributedSmoothNodeBase();

View File

@ -21,13 +21,13 @@
#include "configVariableDouble.h" #include "configVariableDouble.h"
#include "configVariableBool.h" #include "configVariableBool.h"
NotifyCategoryDecl(distributed, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(distributed, EXPCL_DIRECT_DISTRIBUTED, EXPTP_DIRECT_DISTRIBUTED);
extern ConfigVariableInt game_server_timeout_ms; extern ConfigVariableInt game_server_timeout_ms;
extern ConfigVariableDouble min_lag; extern ConfigVariableDouble min_lag;
extern ConfigVariableDouble max_lag; extern ConfigVariableDouble max_lag;
extern ConfigVariableBool handle_datagrams_internally; extern ConfigVariableBool handle_datagrams_internally;
extern EXPCL_DIRECT void init_libdistributed(); extern EXPCL_DIRECT_DISTRIBUTED void init_libdistributed();
#endif #endif

View File

@ -24,7 +24,7 @@
* A constraint interval that will constrain the orientation of one node to * A constraint interval that will constrain the orientation of one node to
* the orientation of another. * the orientation of another.
*/ */
class EXPCL_DIRECT CConstrainHprInterval : public CConstraintInterval { class EXPCL_DIRECT_INTERVAL CConstrainHprInterval : public CConstraintInterval {
PUBLISHED: PUBLISHED:
explicit CConstrainHprInterval(const string &name, double duration, explicit CConstrainHprInterval(const string &name, double duration,
const NodePath &node, const NodePath &target, const NodePath &node, const NodePath &target,

View File

@ -24,7 +24,7 @@
* A constraint interval that will constrain the position and orientation of * A constraint interval that will constrain the position and orientation of
* one node to the position and orientation of another. * one node to the position and orientation of another.
*/ */
class EXPCL_DIRECT CConstrainPosHprInterval : public CConstraintInterval { class EXPCL_DIRECT_INTERVAL CConstrainPosHprInterval : public CConstraintInterval {
PUBLISHED: PUBLISHED:
explicit CConstrainPosHprInterval(const string &name, double duration, explicit CConstrainPosHprInterval(const string &name, double duration,
const NodePath &node, const NodePath &target, const NodePath &node, const NodePath &target,

View File

@ -23,7 +23,7 @@
* A constraint interval that will constrain the position of one node to the * A constraint interval that will constrain the position of one node to the
* position of another. * position of another.
*/ */
class EXPCL_DIRECT CConstrainPosInterval : public CConstraintInterval { class EXPCL_DIRECT_INTERVAL CConstrainPosInterval : public CConstraintInterval {
PUBLISHED: PUBLISHED:
explicit CConstrainPosInterval(const string &name, double duration, explicit CConstrainPosInterval(const string &name, double duration,
const NodePath &node, const NodePath &target, const NodePath &node, const NodePath &target,

View File

@ -22,7 +22,7 @@
* A constraint interval that will constrain the transform of one node to the * A constraint interval that will constrain the transform of one node to the
* transform of another. * transform of another.
*/ */
class EXPCL_DIRECT CConstrainTransformInterval : public CConstraintInterval { class EXPCL_DIRECT_INTERVAL CConstrainTransformInterval : public CConstraintInterval {
PUBLISHED: PUBLISHED:
explicit CConstrainTransformInterval(const string &name, double duration, explicit CConstrainTransformInterval(const string &name, double duration,
const NodePath &node, const NodePath &node,

View File

@ -21,7 +21,7 @@
* The base class for a family of intervals that constrain some property to a * The base class for a family of intervals that constrain some property to a
* value over time. * value over time.
*/ */
class EXPCL_DIRECT CConstraintInterval : public CInterval { class EXPCL_DIRECT_INTERVAL CConstraintInterval : public CInterval {
PUBLISHED: PUBLISHED:
bool bogus_variable; bool bogus_variable;

View File

@ -32,7 +32,7 @@ class CIntervalManager;
* C++ will inherit from this class; Intervals that must be implemented in * C++ will inherit from this class; Intervals that must be implemented in
* Python will inherit from the similar Python class. * Python will inherit from the similar Python class.
*/ */
class EXPCL_DIRECT CInterval : public TypedReferenceCount { class EXPCL_DIRECT_INTERVAL CInterval : public TypedReferenceCount {
public: public:
CInterval(const string &name, double duration, bool open_ended); CInterval(const string &name, double duration, bool open_ended);
virtual ~CInterval(); virtual ~CInterval();
@ -202,7 +202,7 @@ private:
}; };
INLINE ostream &operator << (ostream &out, const CInterval &ival); INLINE ostream &operator << (ostream &out, const CInterval &ival);
EXPCL_DIRECT ostream &operator << (ostream &out, CInterval::State state); EXPCL_DIRECT_INTERVAL ostream &operator << (ostream &out, CInterval::State state);
#include "cInterval.I" #include "cInterval.I"

View File

@ -36,7 +36,7 @@ class EventQueue;
* It is also possible to create multiple IntervalManager objects for special * It is also possible to create multiple IntervalManager objects for special
* needs. * needs.
*/ */
class EXPCL_DIRECT CIntervalManager { class EXPCL_DIRECT_INTERVAL CIntervalManager {
PUBLISHED: PUBLISHED:
CIntervalManager(); CIntervalManager();
~CIntervalManager(); ~CIntervalManager();

View File

@ -29,7 +29,7 @@
* CLerpAnimEffectInterval to adjust the degree to which each animation * CLerpAnimEffectInterval to adjust the degree to which each animation
* affects the actor. * affects the actor.
*/ */
class EXPCL_DIRECT CLerpAnimEffectInterval : public CLerpInterval { class EXPCL_DIRECT_INTERVAL CLerpAnimEffectInterval : public CLerpInterval {
PUBLISHED: PUBLISHED:
INLINE explicit CLerpAnimEffectInterval(const string &name, double duration, INLINE explicit CLerpAnimEffectInterval(const string &name, double duration,
BlendType blend_type); BlendType blend_type);

View File

@ -21,7 +21,7 @@
* The base class for a family of intervals that linearly interpolate one or * The base class for a family of intervals that linearly interpolate one or
* more numeric values over time. * more numeric values over time.
*/ */
class EXPCL_DIRECT CLerpInterval : public CInterval { class EXPCL_DIRECT_INTERVAL CLerpInterval : public CInterval {
PUBLISHED: PUBLISHED:
enum BlendType { enum BlendType {
BT_no_blend, BT_no_blend,

View File

@ -23,7 +23,7 @@
* An interval that lerps one or more properties (like pos, hpr, etc.) on a * An interval that lerps one or more properties (like pos, hpr, etc.) on a
* NodePath over time. * NodePath over time.
*/ */
class EXPCL_DIRECT CLerpNodePathInterval : public CLerpInterval { class EXPCL_DIRECT_INTERVAL CLerpNodePathInterval : public CLerpInterval {
PUBLISHED: PUBLISHED:
explicit CLerpNodePathInterval(const string &name, double duration, explicit CLerpNodePathInterval(const string &name, double duration,
BlendType blend_type, bool bake_in_start, BlendType blend_type, bool bake_in_start,

View File

@ -29,7 +29,7 @@
* own begin and end times. Some of them may overlap and some of them may * own begin and end times. Some of them may overlap and some of them may
* not. * not.
*/ */
class EXPCL_DIRECT CMetaInterval : public CInterval { class EXPCL_DIRECT_INTERVAL CMetaInterval : public CInterval {
PUBLISHED: PUBLISHED:
explicit CMetaInterval(const string &name); explicit CMetaInterval(const string &name);
virtual ~CMetaInterval(); virtual ~CMetaInterval();

View File

@ -20,11 +20,11 @@
#include "configVariableDouble.h" #include "configVariableDouble.h"
#include "configVariableBool.h" #include "configVariableBool.h"
NotifyCategoryDecl(interval, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(interval, EXPCL_DIRECT_INTERVAL, EXPTP_DIRECT_INTERVAL);
extern ConfigVariableDouble interval_precision; extern ConfigVariableDouble interval_precision;
extern EXPCL_DIRECT ConfigVariableBool verify_intervals; extern EXPCL_DIRECT_INTERVAL ConfigVariableBool verify_intervals;
extern EXPCL_DIRECT void init_libinterval(); extern EXPCL_DIRECT_INTERVAL void init_libinterval();
#endif #endif

View File

@ -21,7 +21,7 @@
/** /**
* An interval that calls NodePath::hide(). * An interval that calls NodePath::hide().
*/ */
class EXPCL_DIRECT HideInterval : public CInterval { class EXPCL_DIRECT_INTERVAL HideInterval : public CInterval {
PUBLISHED: PUBLISHED:
explicit HideInterval(const NodePath &node, const string &name = string()); explicit HideInterval(const NodePath &node, const string &name = string());

View File

@ -17,7 +17,7 @@
#include "directbase.h" #include "directbase.h"
#include "typedReferenceCount.h" #include "typedReferenceCount.h"
class EXPCL_DIRECT LerpBlendType : public TypedReferenceCount { class EXPCL_DIRECT_INTERVAL LerpBlendType : public TypedReferenceCount {
PUBLISHED: PUBLISHED:
LerpBlendType() {} LerpBlendType() {}
virtual ~LerpBlendType(); virtual ~LerpBlendType();
@ -47,7 +47,7 @@ private:
static TypeHandle _type_handle; static TypeHandle _type_handle;
}; };
class EXPCL_DIRECT EaseInBlendType : public LerpBlendType { class EXPCL_DIRECT_INTERVAL EaseInBlendType : public LerpBlendType {
PUBLISHED: PUBLISHED:
EaseInBlendType() {} EaseInBlendType() {}
virtual ~EaseInBlendType(); virtual ~EaseInBlendType();
@ -77,7 +77,7 @@ private:
static TypeHandle _type_handle; static TypeHandle _type_handle;
}; };
class EXPCL_DIRECT EaseOutBlendType : public LerpBlendType { class EXPCL_DIRECT_INTERVAL EaseOutBlendType : public LerpBlendType {
PUBLISHED: PUBLISHED:
EaseOutBlendType() {} EaseOutBlendType() {}
virtual ~EaseOutBlendType(); virtual ~EaseOutBlendType();
@ -107,7 +107,7 @@ private:
static TypeHandle _type_handle; static TypeHandle _type_handle;
}; };
class EXPCL_DIRECT EaseInOutBlendType : public LerpBlendType { class EXPCL_DIRECT_INTERVAL EaseInOutBlendType : public LerpBlendType {
PUBLISHED: PUBLISHED:
EaseInOutBlendType() {} EaseInOutBlendType() {}
virtual ~EaseInOutBlendType(); virtual ~EaseInOutBlendType();
@ -136,7 +136,7 @@ private:
static TypeHandle _type_handle; static TypeHandle _type_handle;
}; };
class EXPCL_DIRECT NoBlendType : public LerpBlendType { class EXPCL_DIRECT_INTERVAL NoBlendType : public LerpBlendType {
PUBLISHED: PUBLISHED:
NoBlendType() {} NoBlendType() {}
virtual ~NoBlendType(); virtual ~NoBlendType();

View File

@ -21,7 +21,7 @@
/** /**
* An interval that calls NodePath::show(). * An interval that calls NodePath::show().
*/ */
class EXPCL_DIRECT ShowInterval : public CInterval { class EXPCL_DIRECT_INTERVAL ShowInterval : public CInterval {
PUBLISHED: PUBLISHED:
explicit ShowInterval(const NodePath &node, const string &name = string()); explicit ShowInterval(const NodePath &node, const string &name = string());

View File

@ -21,7 +21,7 @@
* This interval does absolutely nothing, and is mainly useful for marking * This interval does absolutely nothing, and is mainly useful for marking
* time between other intervals within a sequence. * time between other intervals within a sequence.
*/ */
class EXPCL_DIRECT WaitInterval : public CInterval { class EXPCL_DIRECT_INTERVAL WaitInterval : public CInterval {
PUBLISHED: PUBLISHED:
INLINE explicit WaitInterval(double duration); INLINE explicit WaitInterval(double duration);

View File

@ -69,7 +69,7 @@ public:
* coordinate of the texture corresponds to time and the v coordinate * coordinate of the texture corresponds to time and the v coordinate
* corresponds to the "shape" of the motion trail. * corresponds to the "shape" of the motion trail.
*/ */
class EXPCL_DIRECT CMotionTrail : public TypedReferenceCount { class EXPCL_DIRECT_MOTIONTRAIL CMotionTrail : public TypedReferenceCount {
PUBLISHED: PUBLISHED:
CMotionTrail(); CMotionTrail();
~CMotionTrail(); ~CMotionTrail();

View File

@ -14,7 +14,7 @@
#include "config_motiontrail.h" #include "config_motiontrail.h"
#include "dconfig.h" #include "dconfig.h"
extern EXPCL_DIRECT void init_libmotiontrail(); extern EXPCL_DIRECT_MOTIONTRAIL void init_libmotiontrail();
Configure(config_motiontrail); Configure(config_motiontrail);
NotifyCategoryDef(motiontrail, ""); NotifyCategoryDef(motiontrail, "");

View File

@ -20,8 +20,8 @@
#include "cMotionTrail.h" #include "cMotionTrail.h"
NotifyCategoryDecl(motiontrail, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(motiontrail, EXPCL_DIRECT_MOTIONTRAIL, EXPTP_DIRECT_MOTIONTRAIL);
extern EXPCL_DIRECT void init_libmotiontrail(); extern EXPCL_DIRECT_MOTIONTRAIL void init_libmotiontrail();
#endif #endif

View File

@ -26,7 +26,7 @@
#include "configVariableSearchPath.h" #include "configVariableSearchPath.h"
#include "nodePath.h" #include "nodePath.h"
ConfigureDecl(config_showbase, EXPCL_DIRECT, EXPTP_DIRECT); ConfigureDecl(config_showbase, EXPCL_DIRECT_SHOWBASE, EXPTP_DIRECT_SHOWBASE);
class CollisionTraverser; class CollisionTraverser;
class Camera; class Camera;
@ -34,24 +34,24 @@ class GraphicsEngine;
BEGIN_PUBLISH BEGIN_PUBLISH
EXPCL_DIRECT ConfigVariableSearchPath &get_particle_path(); EXPCL_DIRECT_SHOWBASE ConfigVariableSearchPath &get_particle_path();
EXPCL_DIRECT void throw_new_frame(); EXPCL_DIRECT_SHOWBASE void throw_new_frame();
EXPCL_DIRECT DConfig &get_config_showbase(); EXPCL_DIRECT_SHOWBASE DConfig &get_config_showbase();
EXPCL_DIRECT void init_app_for_gui(); EXPCL_DIRECT_SHOWBASE void init_app_for_gui();
// klunky interface since we cant pass array from python->C++ // klunky interface since we cant pass array from python->C++
EXPCL_DIRECT void add_fullscreen_testsize(int xsize, int ysize); EXPCL_DIRECT_SHOWBASE void add_fullscreen_testsize(int xsize, int ysize);
EXPCL_DIRECT void runtest_fullscreen_sizes(GraphicsWindow *win); EXPCL_DIRECT_SHOWBASE void runtest_fullscreen_sizes(GraphicsWindow *win);
EXPCL_DIRECT bool query_fullscreen_testresult(int xsize, int ysize); EXPCL_DIRECT_SHOWBASE bool query_fullscreen_testresult(int xsize, int ysize);
// to handle windows stickykeys // to handle windows stickykeys
EXPCL_DIRECT void store_accessibility_shortcut_keys(); EXPCL_DIRECT_SHOWBASE void store_accessibility_shortcut_keys();
EXPCL_DIRECT void allow_accessibility_shortcut_keys(bool allowKeys); EXPCL_DIRECT_SHOWBASE void allow_accessibility_shortcut_keys(bool allowKeys);
#ifdef IS_OSX #ifdef IS_OSX
EXPCL_DIRECT void activate_osx_application(); EXPCL_DIRECT_SHOWBASE void activate_osx_application();
#endif #endif
END_PUBLISH END_PUBLISH