From 5ac3cf3fc65c6bf447e570a8ad11766af080a49c Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 2 Nov 2018 22:33:16 +0100 Subject: [PATCH 1/3] Eliminate C++ DConfig; replace it with a Python compatibility shim --- .../src/distributed/DistributedSmoothNode.py | 3 +- direct/src/showbase/DConfig.py | 25 ++++++ direct/src/showbase/ShowBase.py | 7 +- direct/src/showbase/ShowBaseGlobal.py | 3 +- direct/src/showbase/showBase.cxx | 8 -- direct/src/showbase/showBase.h | 1 - dtool/src/dconfig/config_dconfig.cxx | 21 ----- dtool/src/dconfig/config_dconfig.h | 29 ------- dtool/src/dconfig/dconfig.I | 42 --------- dtool/src/dconfig/dconfig.cxx | 14 --- dtool/src/dconfig/dconfig.h | 27 +----- dtool/src/dconfig/p3dconfig_composite1.cxx | 3 - dtool/src/dconfig/test_config.cxx | 35 -------- dtool/src/dconfig/test_expand.cxx | 87 ------------------- dtool/src/dconfig/test_pfstream.cxx | 32 ------- dtool/src/dconfig/test_searchpath.cxx | 48 ---------- makepanda/makepanda.py | 25 +++--- panda/src/express/config_express.cxx | 8 -- panda/src/express/config_express.h | 5 -- panda/src/express/virtualFileSystem.cxx | 2 + panda/src/pgraph/config_pgraph.h | 1 + panda/src/putil/config_putil.h | 2 + pandatool/src/progbase/programBase.cxx | 1 - 23 files changed, 51 insertions(+), 378 deletions(-) create mode 100644 direct/src/showbase/DConfig.py delete mode 100644 dtool/src/dconfig/config_dconfig.cxx delete mode 100644 dtool/src/dconfig/config_dconfig.h delete mode 100644 dtool/src/dconfig/dconfig.I delete mode 100644 dtool/src/dconfig/dconfig.cxx delete mode 100644 dtool/src/dconfig/p3dconfig_composite1.cxx delete mode 100644 dtool/src/dconfig/test_config.cxx delete mode 100644 dtool/src/dconfig/test_expand.cxx delete mode 100644 dtool/src/dconfig/test_pfstream.cxx delete mode 100644 dtool/src/dconfig/test_searchpath.cxx diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index 9bc75c1da1..282ec5b88d 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -6,8 +6,7 @@ from .ClockDelta import * from . import DistributedNode from . import DistributedSmoothNodeBase from direct.task.Task import cont - -config = get_config_showbase() +from direct.showbase import DConfig as config # This number defines our tolerance for out-of-sync telemetry packets. # If a packet appears to have originated from more than MaxFuture diff --git a/direct/src/showbase/DConfig.py b/direct/src/showbase/DConfig.py new file mode 100644 index 0000000000..54c90d1566 --- /dev/null +++ b/direct/src/showbase/DConfig.py @@ -0,0 +1,25 @@ +"This module contains a deprecated shim emulating the old DConfig API." + +__all__ = [] + +from panda3d.core import (ConfigFlags, ConfigVariableBool, ConfigVariableInt, + ConfigVariableDouble, ConfigVariableString) + + +def GetBool(sym, default=False): + return ConfigVariableBool(sym, default, "DConfig", ConfigFlags.F_dconfig).value + + +def GetInt(sym, default=0): + return ConfigVariableInt(sym, default, "DConfig", ConfigFlags.F_dconfig).value + + +def GetDouble(sym, default=0.0): + return ConfigVariableDouble(sym, default, "DConfig", ConfigFlags.F_dconfig).value + + +def GetString(sym, default=""): + return ConfigVariableString(sym, default, "DConfig", ConfigFlags.F_dconfig).value + + +GetFloat = GetDouble diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 13b9839255..fcd790e0bf 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -10,8 +10,9 @@ __all__ = ['ShowBase', 'WindowControls'] #import VerboseImport from panda3d.core import * -from panda3d.direct import get_config_showbase, throw_new_frame, init_app_for_gui +from panda3d.direct import throw_new_frame, init_app_for_gui from panda3d.direct import storeAccessibilityShortcutKeys, allowAccessibilityShortcutKeys +from . import DConfig # Register the extension methods for NodePath. from direct.extensions_native import NodePath_extensions @@ -22,7 +23,7 @@ if sys.version_info >= (3, 0): import builtins else: import __builtin__ as builtins -builtins.config = get_config_showbase() +builtins.config = DConfig from direct.directnotify.DirectNotifyGlobal import directNotify, giveNotify from .MessengerGlobal import messenger @@ -57,7 +58,7 @@ def exitfunc(): # *seem* to cause anyone any problems. class ShowBase(DirectObject.DirectObject): - config = get_config_showbase() + config = DConfig notify = directNotify.newCategory("ShowBase") def __init__(self, fStartDirect = True, windowType = None): diff --git a/direct/src/showbase/ShowBaseGlobal.py b/direct/src/showbase/ShowBaseGlobal.py index 459d5f708f..487524dd6a 100644 --- a/direct/src/showbase/ShowBaseGlobal.py +++ b/direct/src/showbase/ShowBaseGlobal.py @@ -12,9 +12,8 @@ from direct.directnotify.DirectNotifyGlobal import directNotify, giveNotify from panda3d.core import VirtualFileSystem, Notify, ClockObject, PandaSystem from panda3d.core import ConfigPageManager, ConfigVariableManager from panda3d.core import NodePath, PGTop -from panda3d.direct import get_config_showbase +from . import DConfig as config -config = get_config_showbase() __dev__ = config.GetBool('want-dev', __debug__) vfs = VirtualFileSystem.getGlobalPtr() diff --git a/direct/src/showbase/showBase.cxx b/direct/src/showbase/showBase.cxx index 7d8973996f..588dbb6540 100644 --- a/direct/src/showbase/showBase.cxx +++ b/direct/src/showbase/showBase.cxx @@ -61,14 +61,6 @@ throw_new_frame() { throw_event("NewFrame"); } -// Returns the configure object for accessing config variables from a -// scripting language. -DConfig & -get_config_showbase() { - static DConfig config_showbase; - return config_showbase; -} - // Initialize the application for making a Gui-based app, such as wx. At the // moment, this is a no-op except on Mac. void diff --git a/direct/src/showbase/showBase.h b/direct/src/showbase/showBase.h index a38a791d3b..b6b90eedd0 100644 --- a/direct/src/showbase/showBase.h +++ b/direct/src/showbase/showBase.h @@ -38,7 +38,6 @@ EXPCL_DIRECT_SHOWBASE ConfigVariableSearchPath &get_particle_path(); EXPCL_DIRECT_SHOWBASE void throw_new_frame(); -EXPCL_DIRECT_SHOWBASE DConfig &get_config_showbase(); EXPCL_DIRECT_SHOWBASE void init_app_for_gui(); // klunky interface since we cant pass array from python->C++ diff --git a/dtool/src/dconfig/config_dconfig.cxx b/dtool/src/dconfig/config_dconfig.cxx deleted file mode 100644 index f828fc8f7d..0000000000 --- a/dtool/src/dconfig/config_dconfig.cxx +++ /dev/null @@ -1,21 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file config_dconfig.cxx - * @author drose - * @date 2000-05-15 - */ - -#include "config_dconfig.h" - -#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_DTOOL_DCONFIG) - #error Buildsystem error: BUILDING_DTOOL_DCONFIG not defined -#endif - -NotifyCategoryDef(dconfig, ""); -NotifyCategoryDef(microconfig, "dconfig"); diff --git a/dtool/src/dconfig/config_dconfig.h b/dtool/src/dconfig/config_dconfig.h deleted file mode 100644 index e01fdcf441..0000000000 --- a/dtool/src/dconfig/config_dconfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file config_dconfig.h - * @author drose - * @date 2000-05-15 - */ - -#ifndef CONFIG_DCONFIG_H -#define CONFIG_DCONFIG_H - -#ifdef WIN32_VC -/* C4231: extern before template instantiation */ -/* MPG - For some reason, this one only works if it's here */ -#pragma warning (disable : 4231) -#endif - -#include "dtoolbase.h" -#include "notifyCategoryProxy.h" - -NotifyCategoryDecl(dconfig, EXPCL_DTOOL_DCONFIG, EXPTP_DTOOL_DCONFIG); -NotifyCategoryDecl(microconfig, EXPCL_DTOOL_DCONFIG, EXPTP_DTOOL_DCONFIG); - -#endif diff --git a/dtool/src/dconfig/dconfig.I b/dtool/src/dconfig/dconfig.I deleted file mode 100644 index e40db3c2b0..0000000000 --- a/dtool/src/dconfig/dconfig.I +++ /dev/null @@ -1,42 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file dconfig.I - * @author cary - * @date 2000-03-20 - */ - -bool DConfig:: -GetBool(const std::string &sym, bool def) { - ConfigVariableBool var(sym, def, "DConfig", ConfigFlags::F_dconfig); - return var.get_value(); -} - -int DConfig:: -GetInt(const std::string &sym, int def) { - ConfigVariableInt var(sym, def, "DConfig", ConfigFlags::F_dconfig); - return var.get_value(); -} - -float DConfig:: -GetFloat(const std::string &sym, float def) { - ConfigVariableDouble var(sym, (double)def, "DConfig", ConfigFlags::F_dconfig); - return (float)var.get_value(); -} - -double DConfig:: -GetDouble(const std::string &sym, double def) { - ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig); - return var.get_value(); -} - -std::string DConfig:: -GetString(const std::string &sym, const std::string &def) { - ConfigVariableString var(sym, def, "DConfig", ConfigFlags::F_dconfig); - return var.get_value(); -} diff --git a/dtool/src/dconfig/dconfig.cxx b/dtool/src/dconfig/dconfig.cxx deleted file mode 100644 index b57f5b70f4..0000000000 --- a/dtool/src/dconfig/dconfig.cxx +++ /dev/null @@ -1,14 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file dconfig.cxx - * @author drose - * @date 1999-02-08 - */ - -#include "dconfig.h" diff --git a/dtool/src/dconfig/dconfig.h b/dtool/src/dconfig/dconfig.h index fca35685ed..fe195bf400 100644 --- a/dtool/src/dconfig/dconfig.h +++ b/dtool/src/dconfig/dconfig.h @@ -15,32 +15,7 @@ #define DCONFIG_H #include "dtoolbase.h" - -#include "config_dconfig.h" -#include "configVariableString.h" -#include "configVariableBool.h" -#include "configVariableInt.h" -#include "configVariableDouble.h" -#include "configVariableList.h" -#include "configFlags.h" - -/** - * This class emulates the old dconfig-style interface to our Panda config - * system. It exists only to provide backward-compatible support, and it is - * used primarily by Python code. For modern code, use the new - * ConfigVariable* interface instead of this deprecated interface. - */ -class EXPCL_DTOOL_DCONFIG DConfig { -PUBLISHED: - static INLINE bool GetBool(const std::string &sym, bool def = false); - static INLINE int GetInt(const std::string &sym, int def = 0); - static INLINE float GetFloat(const std::string &sym, float def = 0.); - static INLINE double GetDouble(const std::string &sym, double def = 0.); - static INLINE std::string GetString(const std::string &sym, const std::string &def = ""); -}; - -#include "dconfig.I" - +#include "notifyCategoryProxy.h" // These macros are used in each directory to call an initialization function // at static-init time. These macros may eventually be phased out in favor of diff --git a/dtool/src/dconfig/p3dconfig_composite1.cxx b/dtool/src/dconfig/p3dconfig_composite1.cxx deleted file mode 100644 index f35232700b..0000000000 --- a/dtool/src/dconfig/p3dconfig_composite1.cxx +++ /dev/null @@ -1,3 +0,0 @@ - -#include "config_dconfig.cxx" -#include "dconfig.cxx" diff --git a/dtool/src/dconfig/test_config.cxx b/dtool/src/dconfig/test_config.cxx deleted file mode 100644 index 2374bd775e..0000000000 --- a/dtool/src/dconfig/test_config.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file test_config.cxx - * @author cary - * @date 1998-09-10 - */ - -#include "dconfig.h" - -using std::cout; -using std::endl; - -#define SNARF -Configure(test); - -std::string foo = test.GetString("user"); -std::string path = test.GetString("LD_LIBRARY_PATH"); - -ConfigureFn(test) -{ - cout << "AIEE! Doing work before main()! The sky is falling!" << endl; -} - -main() -{ - cout << "Testing Configuration functionality:" << endl; - cout << "foo = " << foo << endl; - cout << "path = " << path << endl; -} diff --git a/dtool/src/dconfig/test_expand.cxx b/dtool/src/dconfig/test_expand.cxx deleted file mode 100644 index 334bf2593d..0000000000 --- a/dtool/src/dconfig/test_expand.cxx +++ /dev/null @@ -1,87 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file test_expand.cxx - * @author cary - * @date 1998-08-31 - */ - -#include "expand.h" -#include - -using std::cout; -using std::endl; - -void TestExpandFunction() -{ - std::string line; - - line = "foo"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "'foo'"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "'$USER'"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "$USER"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "\"$USER\""; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "`ls -l`"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "~"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; - line = "~cary"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << Expand::Expand(line) << "'" << endl; -} - -void TestExpandClass() -{ - std::string line; - - line = "foo"; - Expand::Expander ex(line); - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex() << "'" << endl; - line = "'foo'"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "'$USER'"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "$USER"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "\"$USER\""; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "`ls -l`"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "~"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; - line = "~cary"; - cout << "input: '" << line << "'" << endl; - cout << "output: '" << ex(line) << "'" << endl; -} - -main() -{ - cout << endl << "Testing shell expansion (function version):" << endl; - TestExpandFunction(); - cout << endl << "Testing shell expansion (class version):" << endl; - TestExpandClass(); -} diff --git a/dtool/src/dconfig/test_pfstream.cxx b/dtool/src/dconfig/test_pfstream.cxx deleted file mode 100644 index 9b211c2381..0000000000 --- a/dtool/src/dconfig/test_pfstream.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file test_pfstream.cxx - * @author cary - * @date 1998-08-31 - */ - -#include "pfstream.h" -#include - -void ReadIt(std::istream& ifs) { - std::string line; - - while (!ifs.eof()) { - std::getline(ifs, line); - if (line.length() != 0) - std::cout << line << std::endl; - } -} - -main() -{ - IPipeStream ipfs("ls -l"); - - ReadIt(ipfs); -} diff --git a/dtool/src/dconfig/test_searchpath.cxx b/dtool/src/dconfig/test_searchpath.cxx deleted file mode 100644 index 4abf1f71bd..0000000000 --- a/dtool/src/dconfig/test_searchpath.cxx +++ /dev/null @@ -1,48 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file test_searchpath.cxx - * @author cary - * @date 1998-09-01 - */ - -#include "dSearchPath.h" -// #include "expand.h" -#include - -using std::cout; -using std::endl; - -void TestSearch() -{ - std::string line, path; - -// path = ".:~ etc"; - path = ". /etc"; -// path = Expand::Expand(path); - line = "searchpath.h"; - cout << "looking for file '" << line << "' in path '" << path << "': '"; - line = DSearchPath::search_path(line, path); - cout << line << "'" << endl; - - line = ".cshrc"; - cout << "looking for file '" << line << "' in path '" << path << "': '"; - line = DSearchPath::search_path(line, path); - cout << line << "'" << endl; - - line = "passwd"; - cout << "looking for file '" << line << "' in path '" << path << "': '"; - line = DSearchPath::search_path(line, path); - cout << line << "'" << endl; -} - -main() -{ - cout << "Testing search path:" << endl; - TestSearch(); -} diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 7f82da5b80..96effc4c43 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2862,6 +2862,20 @@ except ImportError as err: if "No module named %s" not in str(err): raise""" % (module, module) +panda_modules_code += """ + +from direct.showbase import DConfig + +def get_config_showbase(): + return DConfig + +def get_config_express(): + return DConfig + +getConfigShowbase = get_config_showbase +getConfigExpress = get_config_express +""" + exthelpers_code = """ "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead." from direct.extensions_native.extension_native_helpers import * @@ -3412,13 +3426,6 @@ OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL'] TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx') TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx') -# -# DIRECTORY: dtool/src/dconfig/ -# - -OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG'] -TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx') - # # DIRECTORY: dtool/metalibs/dtoolconfig/ # @@ -3426,7 +3433,6 @@ TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG'] TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx') TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj') -TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj') TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj') TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj') TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll') @@ -5640,7 +5646,6 @@ if (RTDIST): TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm') TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx') TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx') - TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx') TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx') TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx') TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx') @@ -5659,7 +5664,6 @@ if (RTDIST): TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj') - TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj') @@ -5688,7 +5692,6 @@ if (RTDIST): TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj') - TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj') diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index c9e664db34..c147a1ce8f 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -190,11 +190,3 @@ get_verify_dcast() { return *verify_dcast; } - -// Returns the configure object for accessing config variables from a -// scripting language. -DConfig & -get_config_express() { - static DConfig config_express; - return config_express; -} diff --git a/panda/src/express/config_express.h b/panda/src/express/config_express.h index 13719ad8a3..7ec19749f0 100644 --- a/panda/src/express/config_express.h +++ b/panda/src/express/config_express.h @@ -54,11 +54,6 @@ extern ConfigVariableBool multifile_always_binary; extern EXPCL_PANDA_EXPRESS ConfigVariableBool collect_tcp; extern EXPCL_PANDA_EXPRESS ConfigVariableDouble collect_tcp_interval; -// Expose the Config variable for Python access. -BEGIN_PUBLISH -EXPCL_PANDA_EXPRESS DConfig &get_config_express(); -END_PUBLISH - extern EXPCL_PANDA_EXPRESS void init_libexpress(); #endif /* __CONFIG_UTIL_H__ */ diff --git a/panda/src/express/virtualFileSystem.cxx b/panda/src/express/virtualFileSystem.cxx index eb915b566c..84b6f67224 100644 --- a/panda/src/express/virtualFileSystem.cxx +++ b/panda/src/express/virtualFileSystem.cxx @@ -22,6 +22,8 @@ #include "dSearchPath.h" #include "dcast.h" #include "config_express.h" +#include "configVariableList.h" +#include "configVariableString.h" #include "executionEnvironment.h" #include "pset.h" diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index 988c9b1d2b..22050bd75e 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -21,6 +21,7 @@ #include "configVariableInt.h" #include "configVariableDouble.h" #include "configVariableList.h" +#include "configVariableString.h" class DSearchPath; diff --git a/panda/src/putil/config_putil.h b/panda/src/putil/config_putil.h index ec9f683378..dc8681b43c 100644 --- a/panda/src/putil/config_putil.h +++ b/panda/src/putil/config_putil.h @@ -16,9 +16,11 @@ #include "pandabase.h" #include "notifyCategoryProxy.h" +#include "configVariableBool.h" #include "configVariableSearchPath.h" #include "configVariableEnum.h" #include "configVariableDouble.h" +#include "configVariableInt.h" #include "bamEnums.h" #include "dconfig.h" diff --git a/pandatool/src/progbase/programBase.cxx b/pandatool/src/progbase/programBase.cxx index 9cdb70263d..a509e93edf 100644 --- a/pandatool/src/progbase/programBase.cxx +++ b/pandatool/src/progbase/programBase.cxx @@ -19,7 +19,6 @@ #include "dSearchPath.h" #include "coordinateSystem.h" #include "dconfig.h" -#include "config_dconfig.h" #include "string_utils.h" #include "vector_string.h" #include "configVariableInt.h" From b5bf6cd73c0d43f2caf32046143786d874e7227c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 22:40:13 -0600 Subject: [PATCH 2/3] vision: Fix missing includes/declarations --- panda/src/vision/webcamVideoCursorOpenCV.cxx | 7 ++++++- panda/src/vision/webcamVideoCursorOpenCV.h | 1 + panda/src/vision/webcamVideoCursorV4L.cxx | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/panda/src/vision/webcamVideoCursorOpenCV.cxx b/panda/src/vision/webcamVideoCursorOpenCV.cxx index 444557fde8..629cd927ae 100644 --- a/panda/src/vision/webcamVideoCursorOpenCV.cxx +++ b/panda/src/vision/webcamVideoCursorOpenCV.cxx @@ -11,12 +11,17 @@ * @date 2010-10-20 */ -#include "webcamVideoOpenCV.h" +#include "webcamVideoCursorOpenCV.h" #ifdef HAVE_OPENCV +#include "webcamVideoOpenCV.h" +#include "movieVideoCursor.h" + #include "pStatTimer.h" +#include + TypeHandle WebcamVideoCursorOpenCV::_type_handle; /** diff --git a/panda/src/vision/webcamVideoCursorOpenCV.h b/panda/src/vision/webcamVideoCursorOpenCV.h index 6f7e0758f6..3ef1145bc2 100644 --- a/panda/src/vision/webcamVideoCursorOpenCV.h +++ b/panda/src/vision/webcamVideoCursorOpenCV.h @@ -22,6 +22,7 @@ #include "movieVideoCursor.h" class WebcamVideoOpenCV; +struct CvCapture; /** * The Video4Linux implementation of webcams. diff --git a/panda/src/vision/webcamVideoCursorV4L.cxx b/panda/src/vision/webcamVideoCursorV4L.cxx index 95565f9428..8bb77658f6 100644 --- a/panda/src/vision/webcamVideoCursorV4L.cxx +++ b/panda/src/vision/webcamVideoCursorV4L.cxx @@ -11,8 +11,13 @@ * @date 2010-06-11 */ +#include "webcamVideoCursorV4L.h" + +#include "config_vision.h" #include "webcamVideoV4L.h" +#include "movieVideoCursor.h" + #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER) #include From 0b91b3eeb3b0b74e85aa3c7aaf396994e960bf49 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 22:45:34 -0600 Subject: [PATCH 3/3] vrpn: Add VRPN headers to parser-inc, remove CPPPARSER workarounds --- dtool/src/parser-inc/vrpn_Analog.h | 4 ++++ dtool/src/parser-inc/vrpn_Button.h | 4 ++++ dtool/src/parser-inc/vrpn_Configure.h | 3 +++ dtool/src/parser-inc/vrpn_Connection.h | 3 +++ dtool/src/parser-inc/vrpn_Dial.h | 4 ++++ dtool/src/parser-inc/vrpn_Tracker.h | 6 ++++++ panda/src/vrpn/vrpn_interface.h | 10 ---------- 7 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 dtool/src/parser-inc/vrpn_Analog.h create mode 100644 dtool/src/parser-inc/vrpn_Button.h create mode 100644 dtool/src/parser-inc/vrpn_Configure.h create mode 100644 dtool/src/parser-inc/vrpn_Connection.h create mode 100644 dtool/src/parser-inc/vrpn_Dial.h create mode 100644 dtool/src/parser-inc/vrpn_Tracker.h diff --git a/dtool/src/parser-inc/vrpn_Analog.h b/dtool/src/parser-inc/vrpn_Analog.h new file mode 100644 index 0000000000..f8951d032a --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Analog.h @@ -0,0 +1,4 @@ +#pragma once + +class vrpn_Analog_Remote; +typedef void vrpn_ANALOGCB; diff --git a/dtool/src/parser-inc/vrpn_Button.h b/dtool/src/parser-inc/vrpn_Button.h new file mode 100644 index 0000000000..433c282a44 --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Button.h @@ -0,0 +1,4 @@ +#pragma once + +class vrpn_Button_Remote; +typedef void vrpn_BUTTONCB; diff --git a/dtool/src/parser-inc/vrpn_Configure.h b/dtool/src/parser-inc/vrpn_Configure.h new file mode 100644 index 0000000000..9e4a950e73 --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Configure.h @@ -0,0 +1,3 @@ +#pragma once + +#define VRPN_CALLBACK diff --git a/dtool/src/parser-inc/vrpn_Connection.h b/dtool/src/parser-inc/vrpn_Connection.h new file mode 100644 index 0000000000..c35b54de38 --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Connection.h @@ -0,0 +1,3 @@ +#pragma once + +class vrpn_Connection; diff --git a/dtool/src/parser-inc/vrpn_Dial.h b/dtool/src/parser-inc/vrpn_Dial.h new file mode 100644 index 0000000000..34ae1269a7 --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Dial.h @@ -0,0 +1,4 @@ +#pragma once + +class vrpn_Dial_Remote; +typedef void vrpn_DIALCB; diff --git a/dtool/src/parser-inc/vrpn_Tracker.h b/dtool/src/parser-inc/vrpn_Tracker.h new file mode 100644 index 0000000000..2fe1eecd9a --- /dev/null +++ b/dtool/src/parser-inc/vrpn_Tracker.h @@ -0,0 +1,6 @@ +#pragma once + +class vrpn_Tracker_Remote; +typedef void vrpn_TRACKERCB; +typedef void vrpn_TRACKERACCCB; +typedef void vrpn_TRACKERVELCB; diff --git a/panda/src/vrpn/vrpn_interface.h b/panda/src/vrpn/vrpn_interface.h index a788d7ae73..c85c05e31b 100644 --- a/panda/src/vrpn/vrpn_interface.h +++ b/panda/src/vrpn/vrpn_interface.h @@ -16,16 +16,6 @@ #include "pandabase.h" -#ifdef CPPPARSER - // For correct interrogate parsing of UNC's vrpn library. - #if defined(WIN32_VC) || defined(WIN64_VC) - #define SOCKET int - #else - #define linux - typedef struct timeval timeval; - #endif -#endif - // VPRN misses an include to this in vrpn_Shared.h. #include