Crystal Space
Welcome, Guest. Please login or register.
October 21, 2017, 01:06:17 pm

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77560 Members
Latest Member: Rumfortacito113
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Project Development
| |-+  Development Discussion
| | |-+  Python bindings fixed (new event handling issue)
« previous next »
Pages: [1] Print
Author Topic: Python bindings fixed (new event handling issue)  (Read 4695 times)
Posts: 6

View Profile
« on: February 24, 2006, 06:23:29 pm »


  Before anything.. sorry for my english.. hope this is understandable..

  I thanks caedes for all the work and support.

  I would like to explain what were the changes we need to make (and some attempts) to fix the event system in the python binding. Hope this helps to understand the patch (not so difficult..) and helps if other bindings needs fix too.

  The patch is in CVS, and in a few hours an improvement will be there to anonymous CVSers too..

  These are the changes, with a sort description. Ask if need details for anything.. I'll try to answer. Keep in mind I'm not swig expert nor C++ (far from it) Due to this maybe some technical words are missused. Sorry about that.
.The ignore/rename in cspace.i was rewriten because the parameters changed.

."no constructor defined" error
This was raised because the struct fails to complete the new virtual functions created in the eventHandler system change.

   -included SCF_IMPLEMENTS_INTERFACE(iEventHandler). Good.
   -derived from scfImplementation1<_csPyEventHandler,iEventHandler>. Create constructor but the instance is not detected as iEventHandler from swig and fails to match a constructor. Bad.
   -derived from iEventHandler and complete the interface with macro but swig doesn't honor functions in the macro, or the macro is too complex, or something else... "No constructor defined". Bad.
   -derived from iEventHandler, manual writting of functions but now fails to match the list with csEventID[]. This is a good step.
"crystalspace.cspython" is used for StaticHandlerName() any name suggestion is welcome..
.Converting the list into array
   -change some csev* in the list that are incorrect. Good.
   -added constant CS_EVENTLIST_END for list termination. Good.
   -try to create a typemap for csEventID[] parameter with some macros that Rene wrote, but failed to do, even with some modifications. Bad.
   -created the typemap(in), based on Rene code and swig docs, and the list is correctly converted to an array and swig executes SetupEventHandler from Rene wrapping code (class csPyEventHandler, etc..). Good. Maybe swig allows this to be more simple, but this works and swig is huge.. Any suggestion is, of course, welcome.

.Then, only python code: the tutorials. Here the changes are straightforward..
   -change some cscmd* -> csev* and .Type -> .Name / used some 'cache' vars as res2k suggested, thanks.
   -delete duplicated if() about KeyboardDown
   -GetFactory() was removed from iThingState so we need to addapt the code (release notes explains this change)
   -Grouped the not recomended cscmdProcess and cscmdFinalProcess into csevFrame. This is done roughly and I think that, for this examples, is fine, but others uses needs other technique (see Release notes in CS manual)

Note that some tutorials give an assert when exiting..


PD: I'll post this to ML too when my SF account works (it seems it takes some time)
Posts: 32

View Profile Email
« Reply #1 on: August 09, 2017, 09:28:33 am »

Vraiment sympa ce site web
voyance serieuse gratuite
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 8.199 seconds with 18 queries.