common.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # format: class : {method : (prototype1, prototype2)}
  2. # using a "*" means all prototypes
  3. ignored_methods = {
  4. "wxIcon": {'wxIcon': (['const char', 'int', 'int'], )},
  5. }
  6. # these classes are either replaced by different data types in bindings, or have equivalent / better
  7. # functionality provided by the target language.
  8. excluded_classes = [
  9. "wxAny",
  10. "wxAnyValueType",
  11. "wxArchiveClassFactory",
  12. "wxArchiveEntry",
  13. "wxArchiveInputStream",
  14. "wxArchiveIterator",
  15. "wxArchiveNotifier",
  16. "wxArchiveOutputStream",
  17. "wxArray< T >",
  18. "wxArrayString",
  19. "wxAutomationObject",
  20. "wxBufferedInputStream",
  21. "wxBufferedOutputStream",
  22. "wxCharBuffer",
  23. "wxCharTypeBuffer",
  24. "wxClassInfo",
  25. "wxCmdLineParser",
  26. "wxCondition",
  27. "wxConnection",
  28. "wxConnectionBase",
  29. "wxConvAuto",
  30. "wxCountingOutputStream",
  31. "wxCriticalSection",
  32. "wxCriticalSectionLocker",
  33. "wxCSConv",
  34. "wxDatagramSocket",
  35. "wxDataInputStream",
  36. "wxDataOutputStream",
  37. "wxDir",
  38. "wxDirTraverser",
  39. "wxFFile",
  40. "wxFFileInputStream",
  41. "wxFFileOutputStream",
  42. "wxFile",
  43. "wxFileInputStream",
  44. "wxFileName",
  45. "wxFileOutputStream",
  46. "wxFileStream",
  47. "wxFilterClassFactory",
  48. "wxFilterInputStream",
  49. "wxFilterOutputStream",
  50. "wxFSFile",
  51. "wxFSVolume",
  52. "wxFTP",
  53. "wxHashMap",
  54. "wxHashSet",
  55. "wxHashTable",
  56. "wxHTTP",
  57. "wxImage::HSVValue",
  58. "wxImage::RGBValue",
  59. "wxInputStream",
  60. "wxIPAddress",
  61. "wxIPV4Address",
  62. "wxList< T >",
  63. "wxLongLong",
  64. "wxMBConv",
  65. "wxMBConvFile",
  66. "wxMBConvUTF7",
  67. "wxMBConvUTF8",
  68. "wxMBConvUTF16",
  69. "wxMBConvUTF32",
  70. "wxMemoryBuffer",
  71. "wxMemoryFSHandler",
  72. "wxMemoryInputStream",
  73. "wxMemoryOutputStream",
  74. "wxMessageQueue< T >",
  75. "wxModule",
  76. "wxMutex",
  77. "wxMutexLocker",
  78. "wxNode< T >",
  79. "wxObjectDataPtr< T >",
  80. "wxObjectRefData",
  81. "wxOutputStream",
  82. "wxProcess",
  83. "wxProcessEvent",
  84. "wxProtocol",
  85. "wxProtocolLog",
  86. "wxRecursionGuard",
  87. "wxRecursionGuardFlag",
  88. "wxRegKey",
  89. "wxScopedArray",
  90. "wxScopedCharTypeBuffer",
  91. "wxScopedPtr",
  92. "wxScopedPtr< T >",
  93. "wxSharedPtr< T >",
  94. "wxServer",
  95. "wxSockAddress",
  96. "wxSocketBase",
  97. "wxSocketClient",
  98. "wxSocketEvent",
  99. "wxSocketInputStream",
  100. "wxSocketOutputStream",
  101. "wxSortedArrayString",
  102. "wxStopWatch",
  103. "wxStreamBase",
  104. "wxStreamBuffer",
  105. "wxStreamToTextRedirector",
  106. "wxString",
  107. "wxStringBuffer",
  108. "wxStringBufferLength",
  109. "wxStringClientData",
  110. "wxStringInputStream",
  111. "wxStringOutputStream",
  112. "wxTarClassFactory",
  113. "wxTarEntry",
  114. "wxTarInputStream",
  115. "wxTarOutputStream",
  116. "wxTCPClient",
  117. "wxTCPConnection",
  118. "wxTCPServer",
  119. "wxTempFile",
  120. "wxTempFileOutputStream",
  121. "wxTextInputStream",
  122. "wxTextOutputStream",
  123. "wxThread",
  124. "wxThreadEvent",
  125. "wxThreadHelper",
  126. "wxULongLong",
  127. "wxUniChar",
  128. "wxUniCharRef",
  129. "wxURI",
  130. "wxURL",
  131. "wxUString",
  132. "wxVariant",
  133. "wxVariantData",
  134. "wxVector< T >",
  135. "wxVector< T >::reverse_iterator",
  136. "wxWCharBuffer",
  137. "wxWeakRef< T >",
  138. "wxWeakRefDynamic< T >",
  139. "wxZipInputStream",
  140. "wxZipOutputStream",
  141. "wxZlibInputStream",
  142. "wxZlibOutputStream",
  143. ]
  144. def get_first_value(alist):
  145. if len(alist) > 0:
  146. return alist[0]
  147. else:
  148. return ""
  149. def make_enums(aclass):
  150. retval = ""
  151. for enum in aclass.enums:
  152. retval += "enum %s {\n" % enum
  153. num_values = len(aclass.enums[enum])
  154. for value in aclass.enums[enum]:
  155. retval += " %s" % value
  156. if not value == aclass.enums[enum][-1]:
  157. retval += ", "
  158. retval += "\n"
  159. retval += "};\n\n"
  160. return retval