Commit Graph

220 Commits

Author SHA1 Message Date
rdb a9d6d3be46 interrogate: refactor default argument handling 2018-12-26 22:47:14 +01:00
rdb e32388c2f8 interrogate: fix crash reading static property 2018-11-24 22:44:09 +01:00
rdb 598664ab80 interrogate: disambiguate case where static method shadows a property
While it becomes possible to do this now, it should not become standard practice, and we should deprecate cases where we already do it by renaming either the static method or the property.

Fixes #444
2018-11-12 16:31:54 +01:00
Sam Edwards a9dfd8352e general: Distinguish local/system includes
This changes includes so that local includes are consistently
#include "localFile.h"
while system and third-party includes are consistently
#include <systemFile.h>

This commit mostly converts the former to the latter; the two
exceptions are in android_main.cxx and fmodAudioSound.h, where
the reverse was necessary.
2018-11-10 18:00:10 -07:00
rdb 5ba09ec5a0 interrogate: fix compile error when building with LINK_ALL_STATIC
Fixes #442
2018-11-09 11:38:41 +01:00
rdb 49b72fb198 Move Python support code from libp3interrogatedb to generated module
This prevents libp3interrogatedb from having a dependency on the Python library.

See #387
2018-11-06 19:24:37 +01:00
rdb e6f870ece6 Remove Python type tables from interrogatedb 2018-11-05 22:14:25 +01:00
rdb cb9e65720a interrogate: do not use MOVE in generated code, but use std::move 2018-09-09 13:48:50 +02:00
Mitchell Stokes f663d215d5 Remove some unused variables 2018-08-19 16:55:07 +02:00
rdb c4b657b5b2 interrogate: support implicit typecast operators in some cases
For example, this will let us pass a ConfigVariableFilename to anything that accepts a Filename, just like in C++.

Does not work if the return value if the typecast operator requires management.
2018-08-19 16:06:16 +02:00
rdb 68e7f681f4 interrogate: support enum class to limited extent in Python 2
Only the basics are supported; the __members__ or iter interface is not supported at this time.

See also #351 for discussion on pulling in enum34 module.
2018-07-02 12:16:35 +02:00
rdb 9441c28f61 interrogate: do not wrap methods with rvalue arguments
This could in theory be supported, but this is not really intuitive from a Python user's point of view.
2018-06-30 21:38:45 +02:00
rdb b2c04a8c7a interrogate: support scoped enum args and return values 2018-06-30 21:38:40 +02:00
rdb c03a75d755 interrogate: use range for in various places for code cleanliness 2018-06-30 17:18:14 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
rdb b88bd99704 Various compiler warning fixes 2018-06-12 12:38:07 +02:00
rdb 4fe7fe4c88 interrogate: fix int8_t / signed char range checking on Android 2018-06-12 11:08:02 +02:00
rdb 1c476203fc interrogate: remove Dtool_AddToDictionary (let me know if anyone uses this)
If any code is relying on this, please let me know and I will add it back.  It appears to be redundant, though, since one can access DtoolClassDict directly.

Symbol kept around temporarily in order to keep ABI compatibility for a short while as people may not update their interrogate and Panda in sync, but it can soon be removed.
2018-06-11 13:43:30 +02:00
rdb 3cc88cd304 interrogate: clean up py_panda.h a bit more
Inching towards reducing code in py_panda and eventually having no Python-specific code in interrogatedb anymore.
2018-06-11 13:39:45 +02:00
rdb be282627a8 express: make PointerTo directly initializable from nullptr 2018-06-04 11:21:18 +02:00
Sam Edwards a9ffb9630b dtool: Generate code using nullptr over NULL/0 2018-06-03 16:36:07 -06:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
rdb db5dd98d33 general: further warning fixes, use -Wno-unused-variable if NDEBUG
Disabling unused variable checking is needed in NDEBUG builds because of the heavy use of temporary variables in asserts.
2018-05-30 22:51:04 +02:00
rdb 6b726fa697 general: fix various compiler warnings and issues exposed thereby 2018-05-30 11:09:35 +02:00
rdb 3b4d12cb99 interrogate: also fall back to compare_to in Python 2
This is to create the same behaviour in Python 2 and 3.
2018-05-21 11:55:46 +02:00
rdb 7125a3e587 interrogate: allow passing None for args that have NULL as default value 2018-04-05 20:49:13 +02:00
rdb 2450f31ef5 interrogate: remove deprecated and unneeded downcastTo*() functions
They have not been needed for a very long time, and they create an awkward reverse dependency of base classes on derived classes.
2018-02-27 15:06:12 +01:00
rdb 193e4b5f59 interrogate: clean py_panda.h; use macros to access Dtool_PyInstDef 2017-12-12 23:03:38 +01:00
rdb 69b3468b2c interrogate: more improvements to seq/map wrappers
Gets rid of properties defined as both MAKE_SEQ_PROPERTY/MAKE_MAP_PROPERTY, which are just a bad idea. Instead, adds a way for map properties to define a separate "keys" interface.

Fixes: #203
2017-11-27 17:29:50 +01:00
rdb 404842e70b interrogate: fix warning message caused by erroneously wrapped remap
Fixes: #191
2017-11-11 20:36:58 +01:00
rdb b8bf8bd641 interrogate: fix crash when calling functions returning TypedWritable 2017-11-08 00:04:00 +01:00
rdb 1b1d80cd27 More thoroughly fix issues with pickling Panda objects in Python 3
This also adds DatagramBuffer, a class for writing datagrams to memory and reading them from there again.
2017-11-08 00:02:35 +01:00
rdb 483a491ed7 interrogate: simplify coercion code
This remove support for coercing non-ReferenceCounted types that are neither default-constructible nor move-assignable, but it turns out none of the classes we really need it for matches that.
It further cuts down on the amount of code that is being generated to support coercion in cases where it makes absolutely no sense.
2017-11-06 19:53:38 +01:00
rdb 96d237377b interrogate: add various sequence/mapping methods to seq/map property 2017-11-05 18:01:39 +01:00
rdb 0c0f9adab9 Support coroutines and async/await in the task manager and loader 2017-10-31 18:56:41 +01:00
rdb 51d948a7fa Support compilation for Python 3.7 2017-10-13 12:40:47 +02:00
rdb 464cd5fc8b Replace __builtin_expect macros with LIKELY/UNLIKELY 2017-10-09 00:22:28 +02:00
rdb bf190f7306 interrogate: support MAKE_MAP_PROPERTY 2017-10-09 00:02:46 +02:00
rdb 0e2b14cf4c pgraph: custom binding for set_shader_input()
Should be faster and more reliable at PTA handling
We no longer need the interrogate perf hack for the first-arg InternalName

Fixes: #161
2017-10-08 17:50:28 +02:00
rdb 7ff8b62fb8 interrogate: various fixes:
* handle static methods with explicit self
 * fix len() and __setitem__ of mapping types
 * fix inheritance of __getattr__ and __setattr__
 * fix overload resolution error with nullptr_t arguments
 * bool overloads now come after float/double overloads
 * record whether class is final in interrogatedb
 * add Dtool_EmptyTuple
 * optimization for final classes: no need for downcast
2017-09-19 18:46:21 +02:00
rdb d1c34c3360 interrogate: support static properties 2017-08-07 22:04:56 +02:00
rdb a387fb9f35 interrogate: nullptr handling, faster kwargs handling in some cases 2017-05-14 22:19:25 +02:00
rdb e1c916cdc3 interrogate: handle implicit destructors correctly 2017-04-02 14:44:51 +02:00
Sam Edwards ea1ba281b5 interrogate: Add missing cast in generated calls to PyObject_INIT_VAR 2017-03-08 01:54:21 -07:00
rdb cfe810ace7 Add set_shader_inputs for efficiently setting multiple shader inputs 2017-02-06 13:16:27 +01:00
rdb 4ed199cece Fix various compile warnings and a few code consistency issues 2017-01-09 20:36:53 +01:00
rdb 32377cb618 interrogate: fix to allow pointers to forcetyped classes 2016-12-07 23:04:15 +01:00
rdb 29411f5e14 Merge remote-tracking branch 'origin/release/1.9.x' 2016-10-31 22:32:39 +01:00
rdb 5832ab8099 Fix errors when trying to raise vectors to a power 2016-10-31 22:10:47 +01:00
rdb 47388b0dbc Separate out CPython calls from core libs; eliminate need for pystub 2016-07-20 14:30:41 +02:00