Go for it...<br><br><br><div><span class="gmail_quote">On 3/10/08, <b class="gmail_sendername">Sean McBride</b> <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br> <br> VTK provides the public class vtkCocoaGLView. It is a subclass of<br> Apple's NSView. NSView is an Objective-C class. vtkCocoaGLView is a so-<br> called Objective-C++ class, meaning that it is an Objective-C class but<br>
it has some C++ syntax (needed because it has methods and instance<br> variables with C++ types). This is absolutely fine, working, common,<br> and well-supported. However...<br> <br> Apple's Xcode 3 IDE provides some code refactoring features which are<br>
extremely useful, however they only support Objective-C, not C++ and not<br> even Objective-C++.<br> <br> Every time I #include vtkCocoaGLView.h I am forced to make my files .mm<br> instead of .m (Obj-C++ vs Obj-C). Then I loose refactoring for those<br>
files. :(<br> <br> I have a fix, and want to see if anyone objects... Basically,<br> vtkCocoaGLView.h can be summarised as:<br> <br> --------<br> class vtkCocoaRenderWindow; // fwd declare<br> <br> @interface vtkCocoaGLView : NSView<br>
{<br> vtkCocoaRenderWindow* ivar;<br> }<br> <br> - (vtkCocoaRenderWindow*)method;<br> @end<br> --------<br> <br> Where vtkCocoaRenderWindow is a C++ type. I'd like to change it to:<br> <br> --------<br> #ifdef __cplusplus<br>
class vtkCocoaRenderWindow; // fwd declare<br> typedef vtkCocoaRenderWindow* vtkCocoaRenderWindowRef;<br> #else<br> typedef void* vtkCocoaRenderWindowRef;<br> #endif<br> <br> @interface vtkCocoaGLView : NSView<br>
{<br> vtkCocoaRenderWindowRef ivar;<br> }<br> <br> - (vtkCocoaRenderWindowRef)method;<br> @end<br> --------<br> <br> Now, if vtkCocoaGLView.h is included by a .m file it sees pure Obj-C, if<br> it is included by a .mm files it sees Obj-C++.<br>
<br> It's not too ugly... :) Any objections?<br> <br> Thanks,<br> <br> --<br> ____________________________________________________________<br> Sean McBride, B. Eng <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
Rogue Research <a href="http://www.rogue-research.com">www.rogue-research.com</a><br> Mac Software Developer Montréal, Québec, Canada<br> <br> _______________________________________________<br>
vtk-developers mailing list<br> <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
</blockquote></div><br>