Some code Refactoring

jgmdev
Created by: jgmdev
Date: 12/19/2011 @ 2:19:21 pm
Views: 667

Extension Generator

Finally I took the time to re-analyze the generator and started some refactoring, since the current code has many obscure variable names making it harder to understand and update. Also I'm cleaning the traits of old code that isn't used anymore as I have seen by studying the source. Thanks to this and some research of the sparse documentation available to develop PHP extensions my understanding is becoming much clearer. Other minor change but important was to the config.m4 file, so that passing the DIR (--with-wxwidgets=[DIR]) where wxWidgets is installed really works, as added a new flag (--enable-wxwidgets-debug) to enable debugging code on wxPHP to help troubleshooting of wrong method calls and logical errors on the generated code.

Doxygen XML Extractor

I have re-started working on what will be the next iteration of wxPHP supporting the next generation of wxWidgets 3.x. While on the endeavour I noticed some bugs on the initial code used to extract the library information from the wxWidgets XML doxygen documentation. The most serious of them, and that may cause any previous attempt to compile with wxWidgets 2.9.x with a bunch of errors was the addition of parent classes that didn't belonged to a particular class. The reason was bad parsing of the inheritancegraph nodes. Another bug was the wrong usage of the serialized class enumerations on the code generator. Also I noticed that some base classes used as return and parameter types for methods aren't documented resulting on incomplete information for the code generator.

Here is the list of bases classes that aren't documented by doxygen:

  • wxAffineMatrix2DBase
  • wxWindowBase
  • wxCharTypeBufferBase
  • wxScopedCharTypeBufferBase
  • wxPrintPreviewBase
  • wxHelpControllerBase
  • wxMDIClientWindowBase
  • wxPGVIteratorBase
  • wxPropertyGridIteratorBase
  • wxRibbonButtonBarButtonBase
  • wxRibbonToolBarToolBase
  • wxToolBarToolBase
  • wxToolBarBase

Up to now I haven't thought about a solution to these other than manually documenting these classes and regenerating the doxygen xml files. I wrote a message to the wx-dev news group (about the base classes not documented) using googlegroups interface to seek some ideas but until now it hasn't show up.

The Future

I'm planning to commit a new branch, with the new code as soon as It becomes more mature, some time in between January and February. Worst case would be unknown date after February :S.

Other than what said above I feel that a future release with wxWidgets 2.9.x - 3.x  is becoming nearer than what I initially thought :D


Grettings to all!

Comments