Commit Graph

80 Commits

Author SHA1 Message Date
Robin Dunn
9823b387dd Add support for NoSetter annotation and GetCode, SetCode directives 2019-04-13 13:55:22 -07:00
Robin Dunn
8f07ca5c28 wxRealPoint::operator* truncates to int before assigning to the new point
object, which seems dumb. So let's make our own implementation which
preserves the floating point result.
2018-09-25 12:42:22 -07:00
Robin Dunn
b410f5e570 Update copyright years --> 2018 2018-06-06 10:59:51 -07:00
Robin Dunn
fc2c6cda57 Add support for using the /Constrained/ annotation 2017-09-14 19:53:17 -07:00
Robin Dunn
875c9677ac Revert auto-propagating the mustHaveAppFlag from classes to their static methods, if any, and explicitly set the flag on only those static methods that need it instead. 2017-03-21 19:21:07 -07:00
Robin Dunn
9d172ddc8a Update copyright in etgtools 2017-02-13 16:18:47 -08:00
Robin Dunn
bd0927fb02 Also protect static methods in mustHaveApp classes 2017-01-21 18:59:08 -08:00
Robin Dunn
6c65fbb865 Use the new %PreMethoCode directive to implement the mustHaveApp functionality
(Raises an exception if protected items are called before the wx.App has been created.)
2017-01-21 18:56:41 -08:00
Metallicow
067569d785 Trim trailing space etgtools directory 2016-12-05 16:26:04 -06:00
Robin Dunn
1429bb0dd2 Add missing "PyErr_Clear();" for cppCtors 2016-08-05 12:00:17 -07:00
Robin Dunn
a485513e4a Update copyright text added written to %Copying blocks 2016-06-21 20:28:15 -07:00
Robin Dunn
e2f853d0e0 Put the module docstrings on the module index pages
Plus some other changes to start using using the "wx." prefix on names in the docs. (More are still needed but this is a start.
2016-05-19 21:04:14 -07:00
Robin Dunn
f8d638b64e Update copyrights in sip_generator too 2016-05-07 19:16:27 -07:00
Robin Dunn
c96d31f919 Instead of hacking the generated C++ after the fact,
generate the sip code a little differently for the int tricky constants,
and add some tests.
2016-05-07 01:27:28 -07:00
Scott Talbert
aa0be2719e Fix extraction for #define's when not an integer or string
Some #define values fall outside the range of int, so we need to override the
types.
2016-03-01 22:50:19 -05:00
Robin Dunn
30e7d68f76 Allow typedefs to be nested in classes. 2015-03-03 20:53:18 -08:00
Robin Dunn
742d02d53b Enable handling #define's that are string constants
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-12 05:12:23 +00:00
Robin Dunn
35fd2e16bf Update copyright year
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-21 02:13:03 +00:00
Robin Dunn
0e6e598099 Support isStatic for PyMethods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-23 03:08:03 +00:00
Robin Dunn
ae54ccbb3a Don't skip writing the overloads when one has MethodCode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-30 22:31:05 +00:00
Robin Dunn
31d92bb01f Enable adding and generating code for a cpp dtor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-17 22:21:19 +00:00
Robin Dunn
dea1c34ef6 Allow specifying the cppSignature for regular methods too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-17 22:20:00 +00:00
Robin Dunn
e8d7197917 Allow cppSignature and pyArgsString for CppMethods too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-09 04:38:43 +00:00
Kevin Ollivier
3670519430 Enable etg code to be used to build extensions other than Phoenix itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-11 17:42:05 +00:00
Robin Dunn
0fa4a65870 enable setting the new sip %InstanceCode directive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-10 05:15:47 +00:00
Robin Dunn
aebd862d14 Provide hints for deprecated items about what should be used instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-10 05:15:17 +00:00
Robin Dunn
b8ca4e1102 Allow setting virtual catcher code for normal methods too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-30 21:01:16 +00:00
Robin Dunn
f697317ebc Classes without explicit bases still derive from object
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-12 20:56:15 +00:00
Robin Dunn
cb2f179d20 bug fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-08 05:13:41 +00:00
Robin Dunn
d472962864 Wordwrap the text used for docstrings.
Put the signatures for the ctors before the text, just like the other functions, methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-08 05:13:28 +00:00
Robin Dunn
3426d72bc3 Some little tweaks and fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-06 01:15:14 +00:00
Robin Dunn
2011586fa0 Use codecs.open in textfile_open() for Py2.7 so it can work more like open() in Py3, auto-converting to/from utf-8 and unicode. Use textfile_open in parts of the sphinx command that were having encoding errors and also in writeIfChanged().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-25 20:43:48 +00:00
Robin Dunn
b41df0b779 Many, many (many!) changes needed to build and run the Phoenix extension modules with Python 3. Where possible changes were made such that the code works with both Python 2.7 and 3.2 without conditionals. In general the following types of changes were made:
* Changed imports to use either absolute or explicit relative imports.  Implicit relative imports are no longer allowed.

 * Changes to accomodate standard library classes or modues moving to other locations, or being removed entirely.

 * Changes related to print becoming a function, execfile being removed, u'' no longer allowed, and other syntax related issues.

 * Working around C APIs that have changed or simply vanished. (PyInt, PyString, PyBytes, etc.)

 * Dealing with text file objects using strings vs binary file objects using bytes, auto-encoding, and etc.

 * Replacing the use of PyCObject with PyCapsule and dealing with an apparent bug where PyCapsule objects can't be imported from submodules within a package.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-24 23:28:02 +00:00
Robin Dunn
ec06cdb967 indent the GIL macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:39:12 +00:00
Robin Dunn
6742c20040 Release the GIL when calling the function generated for CppMethod objects.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:38:57 +00:00
Robin Dunn
15115dca23 * Allow defining the real C++ signature of a method or ctor that we are replacing with a custom method with a different signature. This is important when the original is a ctor or a virtual method, and so there will need to be a matching method/ctor for it in the custom derived class generated by SIP.
* Also support defining the code to be used in the "virtual catcher" so we can map between the real signature and our custom signature when reflecting the call to Python code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:38:45 +00:00
Robin Dunn
33a6da35ee Remove wx prefixes for default values in the pyArgsString.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 23:30:48 +00:00
Robin Dunn
7b6a094c4f Add support for using SIP's NoArgParser annotation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-26 01:29:28 +00:00
Robin Dunn
a143905fef Don't write sip docstrings for functions that are operators
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-29 16:58:54 +00:00
Robin Dunn
1d54d41e7b Encode generator output as utf-8 in case there is any non-ascii text
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-26 19:22:19 +00:00
Robin Dunn
16109cd7bc Support setting the HoldGIL annotation for when the -g command line flag is used to always release and reacquire by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-23 03:19:51 +00:00
Robin Dunn
32c3701e4e Allow CppMethodDefs to be static. Replace :: with . in generated pyArgsStrings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-02 21:53:15 +00:00
Robin Dunn
1d61826362 * Include inner classes in a ClassDef's allItems
* Enable finding an overload based on its constness
* Add FunctionDef.renameOverload
* Write nested enums before inner classes and ctors in the sip generator.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-02 21:53:00 +00:00
Robin Dunn
5078b242f4 Add support for the NoTypeName annotation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-27 23:52:30 +00:00
Robin Dunn
a47c664ec3 Prevent from generating some syntax errors in the pi_generator, and other generator tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-22 01:20:25 +00:00
Robin Dunn
9912e33123 * Add PyFunctionDef and PyClassDef extractor classes, which can be used for defining pure python functions and classes instead of just including them as blocks of text. This way the meta-data is preserved so it can be used by generators such as the sphinx generator.
* Implement wx.CallAfter and wx.CallLater this way for the initial test cases.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-15 02:36:01 +00:00
Robin Dunn
06a7072ddf docstring fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-10 04:36:51 +00:00
Robin Dunn
a236ea1867 * Use all_raise_py_exception=True in the %Module directive.
* remove pyRaisesException (May want to add it back later with different meaning...)
* Fix use of const for CppMethods
* Make flattenNode optionally not rstrip the string segments

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-02 01:10:49 +00:00
Robin Dunn
fd0a62c1c4 check for overloads when it's a CppMethod too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-17 03:51:02 +00:00
Robin Dunn
8f8c7a3d43 Add the ability to raise a wx.PyAssertionError when a wxASSERT (or other similar debug macros) fail. To do this support for the /RaisesPyException/ annotation is added, but it defaults to turned on for every function or non-ctor method.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-10 02:43:05 +00:00