Commit graph

273 commits

Author SHA1 Message Date
William S Fulton
01fa85bda7 Add %feature("csdirectordelegatemodifiers") for C#
Enable customization of the delegate access modifiers generated in director classes.
Fixes https://github.com/swig/swig/issues/748
2016-12-24 17:14:36 +00:00
Vladimir Kalinin
0145a07cc3 fix for nested ignored types 2016-05-18 18:07:04 +03:00
William S Fulton
ac495d5c66 Merge branch 'char-escaping'
* char-escaping:
  Add missing string_constant.i testcase
  changes file update for char wrappers
  C# char wrappers fixes for enum values, static const member char values and %csconst
  D testing added for %dmanifestconst and char constants
  Fix wrapping D constants using %dmanifestconst
  Php fix for enum value of '\0'
  Fix static const char member variables wrappers with %javaconst(1).
  Expand char testing in enums and %constant
  Java char changes file update
  Java enum and static member variable escaping fix for chars
  Add tests for enum values and static const member variables chars containing escape sequences
  Minor documentation tweak

Conflicts:
	CHANGES.current
2016-03-12 23:27:51 +00:00
William S Fulton
5fb6537f69 C# char wrappers fixes for enum values, static const member char values and %csconst
Use hex escaping for char values used as C# constants
2016-03-12 18:52:49 +00:00
William S Fulton
2dec8c5514 Add limited support for %interface_impl and %shared_ptr 2016-03-06 21:20:23 +00:00
William S Fulton
21ee09fc19 Multiple inheritance warning wording tweak 2016-03-06 10:45:39 +00:00
Vladimir Kalinin
7e0b5ccf44 C# "override" fix for "extend" case 2016-03-05 19:34:38 +03:00
William S Fulton
7d76617dc3 Add checks for interface name symbol clashes 2016-03-03 22:48:35 +00:00
William S Fulton
a1245ef398 Re-organization of the interface feature common code
Move code to new feature.cxx file.
Activate it in the allocate phase rather than in individual languages.
2016-03-03 08:55:20 +00:00
William S Fulton
14d2341512 Add $interfacename family of special variable expansions
This is a simple expansion expanding to the name of the interface and is
not qualified like $javainterfacename and $csinterfacename.
Expansion within typemaps is much like $javainterfacename otherwise.
Note that expansion within the pure java code typemap,
'javainterfacecode' and similarly pure C# code typemap,
'csinterfacecode' works like $javaclassname/$csclassname and
$&interfacename should not be used, just $interfacename.
2016-02-29 21:18:42 +00:00
William S Fulton
c71dba5021 Interface name handling improvements and special variable changes
Support expansion of name attribute in: %feature("interface", name="%s")
%s expands to the proxy class name and all the usual %rename functions
can be used (regex, strip, camelcase etc) to derive the interface name
from the proxy class name.
Rename $interfacename family of special variables to $javainterfacename for Java
Rename $interfacename family of special variables to $csinterfacename for C#
This is to free up $interfacename for simple interface name expansion in forthcoming commit
2016-02-29 20:18:01 +00:00
William S Fulton
2f1c34be58 Support namespaces and nspace with the interface feature for C# 2016-02-26 18:17:20 +00:00
William S Fulton
e7bb3afa0c Create javainterfacecode and csinterfacecode typemaps
The interface feature is no longer hard coded and can
be controlled by a user via these new typemaps.
2016-02-23 07:30:00 +00:00
William S Fulton
66344adf9e Merge branch 'interfaces' of github.com:/swig/swig into interfaces
* 'interfaces' of github.com:/swig/swig:
  IntPtr & HandleRef absolute names used
  virtual/override fix
2016-02-23 07:10:15 +00:00
Vladimir Kalinin
682991762c virtual/override fix 2016-02-14 03:07:53 +03:00
William S Fulton
c33b4dc34e Improve interface feature checks
Use common code for missing feature:interface:name attribute checks
Check that all base classes are also marked as interfaces
2016-02-13 13:03:40 +00:00
William S Fulton
645147a5b2 Comments added to interface feature implementation and cosmetic code changes 2016-02-12 20:23:35 +00:00
William S Fulton
fc4be01106 Refactor multiple inheritance warnings
Slightly simplify choosing single base class when handling
multiple inheritance and make consistent across more languages.
Modula3 multiple inheritance warnings now warn for all bases
2016-02-12 08:45:22 +00:00
Vladimir Kalinin
5768d87deb director generation fixes
Conflicts:
	Lib/java/feature_interface.i
	Source/Modules/csharp.cxx
	Source/Modules/java.cxx
2016-02-12 07:09:17 +00:00
William S Fulton
ccd46ec560 interface feature updates for C# latest on master
Updates for C# fully qualified names in C# layer
More Corrections for C# single output file option (-outfile)
2016-02-11 20:56:33 +00:00
William S Fulton
212300c62b interfaces branch merge fixes 2016-02-11 20:21:25 +00:00
William S Fulton
abccc13a4a Merge branch 'interfaces' into interfaces2
* interfaces:
  Remove unnecessary interfaces for concrete classes
  cosmetic code formatting changes
  Correct interface name attributes that are internal
  interface macro changes to support templates
  Test non-virtual method in Derived classes
  interface tests for a most derived class inheriting the interfaces further up the chain
  Rename GetCPtr/getCPtr to SWIGInterfaceUpcast
  interface feature support for const ref pointers (used by the STL)
  Interface feature support for arrays
  More interface feature testing for return values
  interface feature support for passing by value
  interface feature support for references
  Multiple inheritance parameters as pointers testing
  Simplify multiple_inheritance_abstract Java runtime test
  Warning fixes
  Rename test functions in multiple_inheritance_abstract testcase
  Formatting fixes in generated code for interface feature
  Cosmetic spacing changes in test case
  interface feature typemap corrections to handle NULL pointers
  interface test added
  javadirectorin fix
  interface implementation visibility
  interface inheritance (2)
  interface inheritance (1)
  feature:interface ported to Java
  propagate non-abstract "interface" base methods (3)
  propagate non-abstract "interface" base methods (2)
  propagate non-abstract "interface" base methods (1)
  namespace support added GetCPtr now returns HandleRef "feature:interface:name" is now mandatory attribute
  interfaces (1)
  interfaces (1)

Conflicts:
	Source/Modules/csharp.cxx
	Source/Modules/java.cxx
2016-02-11 19:37:31 +00:00
William S Fulton
993214872f cosmetic code formatting changes 2016-02-09 07:39:46 +00:00
William S Fulton
dd6af222f4 Correct interface name attributes that are internal
Attributes with 'feature:' prefix are reserved for %feature, not internal usage.
2016-02-09 07:22:07 +00:00
William S Fulton
72e5c221b6 Rename GetCPtr/getCPtr to SWIGInterfaceUpcast
This is then similarly named to other similar functions:
SWIGUpcast and SWIGSmartPtrUpcast
2016-02-08 20:49:46 +00:00
William S Fulton
f78b9264b8 Warning fixes 2016-02-06 16:34:33 +00:00
William S Fulton
a7370b7bc0 Formatting fixes in generated code for interface feature 2016-02-06 16:34:24 +00:00
Johan Gustavsson
1458326f4c Update csharp.cxx
When people use the -namespace option, they often intend for the input to swig to wrap a particular namespace in a single module. This option should also have an effect on how C++ wrapper function names are mangled, and not just the C# proxy code.
2016-02-06 08:59:50 +00:00
Petre Eftime
0a07cd4c30 Prevent redefinition warnings when compiling with SWIG<module> defined
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
2015-12-22 14:33:21 +02:00
William S Fulton
faeaacf112 smartptr feature support - factor out common code 2015-09-25 22:57:59 +01:00
William S Fulton
8bd6e596d1 Cosmetics - remove references to Java in C# module 2015-06-11 19:39:51 +01:00
William S Fulton
2b9b007027 C# -outfile cosmetic code fixes 2015-06-11 07:42:50 +01:00
Frederick Parotat
b83307e354 [C#] Single file mode (fixes)
Renamed argument '-csout' to '-outfile'.
Reformatting (Tab spacing; Pointer style).
Chagned html documentation.
2015-06-04 14:15:00 +02:00
Frederick Parotat
0b09978219 [C#] Single file mode (minor fix)
Removed debug output
2015-06-03 14:26:38 +02:00
Frederick Parotat
747e22f714 [C#] Single file mode
Added "-csout <path>" parameter. If supplied all generated C# code will
be written to the given file. Makes it easier to integrate SWIG into
automated script based build processes.
2015-06-03 14:19:13 +02:00
Olly Betts
084f72452f Fix javadowncast to csdowncast in C# backend
See issue#367.
2015-03-30 08:38:24 +13:00
James Athey
7a050461c6 When warning about multiple inheritance in C#, say C# in the message instead of Java 2015-03-26 11:11:11 -04:00
Olly Betts
7ba0652677 Create director_common.swg for language-indep code
Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for
all languages with director support, not just Python and PHP.
2015-03-12 19:51:11 +13:00
William S Fulton
2e01533b23 Partial support for %constant and structs
Test case is slightly modified from the test case in issue #250

Use of constant objects does not seem to work in Python - the type is
SwigPyObject instead of constant_directive.Type1.
2014-12-18 07:01:08 +00:00
William S Fulton
366948079f Add C# support for wrapping C++11 strongly typed enums 2014-11-25 07:07:47 +00:00
William S Fulton
fcef37d682 Fix incorrect symbol clash error in C# and Java when using %rename for enums
When using using 'simple enum' wrappers
2014-11-21 19:50:23 +00:00
William S Fulton
ede58b8744 Cosmetic formatting 2014-11-21 18:58:08 +00:00
William S Fulton
36ae32e941 Merge remote-tracking branch 'vadz/py-args'
* vadz/py-args:
  Allow using enum elements as default values for Python functions.
  Don't always use "*args" for all Python wrapper functions.
  No real changes, just make PYTHON::check_kwargs() const.
  Refactor: move makeParameterName() to common Language base class.
  Remove long line wrapping from Python parameter list generation code.
2014-10-27 20:02:59 +00:00
William S Fulton
b57a675d00 Cosmetic comment changes
Note: copyrights are in the COPYRIGHT file
2014-10-21 07:34:51 +01:00
Vadim Zeitlin
9f1af8921f Refactor: move makeParameterName() to common Language base class.
This method was duplicated more or less identically for 4 languages and will
be needed for another one soon, so put it in the base class from which it can
be simply reused instead.

No changes in the program behaviour whatsoever.
2014-08-16 13:11:22 +02:00
William S Fulton
69736cc0cb Tweak generated C# .cs files header 2014-08-04 19:41:38 +01:00
gpetrou
8433539849 Changed CSharp license header to include auto-generated tag so that StyleCop ignores the files. 2014-08-02 08:35:15 +01:00
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
William S Fulton
dc8428889e Ignored enum fixes.
C#/Java - Enums which have been ignored via %ignore and are subsequently
used are handled slightly differently. Type wrapper classes are now generated
which are effectively a wrapper of an empty enum. Previously in Java uncompilable
code was generated and in C# an int was used.
2014-04-08 23:25:27 +01:00
William S Fulton
cd2085aae7 Fixes for C enums used in an API and the definition of the enum has not been parsed.
For D, this fixes a segfault in SWIG.

Java, C#, D, Go now produce code that compiles, although the definition of the
enum is needed in order to use the enum properly from the target language.
2014-03-28 07:54:03 +00:00